我有这个简单的警告框,显示一条简单的消息,但是当文本太长时,它会被切断..有没有办法可以设置警报框的宽度.. < / p>
我试过Ext.Msg.MinWidth = 300;
但那不起作用
onForgotPwdTap: function(button, e, eOpts) {
Ext.Msg.alert('Forgot Password?', 'Please contact your administrator for password assistance.', Ext.emptyFn);
}
答案 0 :(得分:0)
你可以尝试获取这样的屏幕尺寸:
Display display = getWindowManager().getDefaultDisplay();
int mwidth = display.getWidth();
int mheight = display.getHeight();
And then alter the Dialog like this:
AlertDialog.Builder adb = new AlertDialog.Builder(this);
Dialog d = adb.setView(new View(this)).create();
// (That new View is just there to have something inside the dialog that can grow big enough to cover the whole screen.)
d.show();
WindowManager.LayoutParams lp = new WindowManager.LayoutParams();
lp.copyFrom(d.getWindow().getAttributes());
lp.width = mwidth;
lp.height = myheight;
//change position of window on screen
lp.x = mwidth/2; //set these values to what work for you; probably like I have here at
lp.y = mheight/2; //half the screen width and height so it is in center
//set the dim level of the background
lp.dimAmount=0.1f; //change this value for more or less dimming
d.getWindow().setAttributes(lp);
//add a blur/dim flags
d.getWindow().addFlags(WindowManager.LayoutParams.FLAG_BLUR_BEHIND | WindowManager.LayoutParams.FLAG_DIM_BEHIND);