80,352
社区成员
发帖
与我相关
我的任务
分享
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getAttributes().width = LayoutParams.WRAP_CONTENT;
getWindow().getAttributes().gravity = Gravity.RIGHT;
}
fanhui.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {
// TODO Auto-generated method stub
Intent function = new Intent();
function.setClass(UserJiuGongGeActivity.this, FunctionActivity.class);
startActivity(function);
}
});
dialog是Activity,是由intent启动的,没办法用你那个方法啊? Dialog dialog = getDialog();
Window window = dialog == null ? null : dialog.getWindow();
if (dialog != null && window != null) {
LayoutParams attr = window.getAttributes();
if (attr != null) {
attr.height = android.view.ViewGroup.LayoutParams.MATCH_PARENT;
attr.gravity = Gravity.RIGHT;
}
}