本文整理匯總了Java中android.view.WindowManager.LayoutParams.MATCH_PARENT屬性的典型用法代碼示例。如果您正苦於以下問題:Java LayoutParams.MATCH_PARENT屬性的具體用法?Java LayoutParams.MATCH_PARENT怎麽用?Java LayoutParams.MATCH_PARENT使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.view.WindowManager.LayoutParams
的用法示例。
在下文中一共展示了LayoutParams.MATCH_PARENT屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: show
@Override
public void show() {
Window dialogWindow = getWindow();
LayoutParams lp = dialogWindow.getAttributes();
lp.width = LayoutParams.MATCH_PARENT;
lp.height = LayoutParams.MATCH_PARENT;
/*WindowManager m = context.getWindowManager();
Display d = m.getDefaultDisplay(); // 獲取屏幕寬、高用
lp.width = d.getWidth();*/
dialogWindow.setAttributes(lp);
EventBus.getDefault().register(this);
super.show();
}
示例2: EasyAlertDialog
public EasyAlertDialog(Context context, int resourceId, int style) {
super(context, style);
this.context = context;
if (-1 != resourceId) {
setContentView(resourceId);
this.resourceId = resourceId;
}
WindowManager.LayoutParams Params = getWindow().getAttributes();
Params.width = LayoutParams.MATCH_PARENT;
Params.height = LayoutParams.MATCH_PARENT;
getWindow().setAttributes((android.view.WindowManager.LayoutParams) Params);
}
示例3: EasyEditDialog
public EasyEditDialog(Context context, int resourceId, int style) {
super(context, style);
mMaxEditTextLength = 16;
if (-1 != resourceId) {
setContentView(resourceId);
this.mResourceId = resourceId;
}
LayoutParams Params = getWindow().getAttributes();
Params.width = LayoutParams.MATCH_PARENT;
Params.height = LayoutParams.MATCH_PARENT;
getWindow().setAttributes(Params);
}