如何在Android中设置警报对话框的高度和宽度?
这是我的代码:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
context = this;
AlertDialog alertChoice = new AlertDialog.Builder(context).create();
alertChoice.setTitle("Title");
alertChoice.setView(ViewDialogScreen("Test"));
alertChoice.show();
}
private View ViewDialogScreen(String strText) {
LinearLayout llay = new LinearLayout(context);
llay.setLayoutParams(new LayoutParams(320, 400));
TextView tv = new TextView(context);
tv.setText(strText);
llay.addView(tv);
return llay;
}
我得到了如上所述的输出。
我需要以全屏/ 95%的屏幕尺寸显示AlertDialog
。
我需要处理Dialog
中的更多字段。
如何启用AlertDialog
中的HorizontalScrollview
?
没有找到相关结果
已邀请:
3 个回复
貉骂
,这将使你的
方法:
现在尝试添加更多字段,它应该滚动。
搂腹时
揽芳僵迷仇
,则需要创建自定义
。