【发布时间】:2013-06-06 06:24:58
【问题描述】:
我是一名 android 初学者,正在制作我的第一个 android 应用程序。我的“关于”菜单项,单击时会显示一个带有很长消息的 AlertDialog。 我一直在尝试不同的方法使其可滚动,但我做不到。我曾尝试阅读有关 StackOverflow 的不同问题,但它们对我不起作用。这是我的 AlertDialog 代码。
AlertDialog.Builder alertDialog = new AlertDialog.Builder(this);
alertDialog.setTitle("Title");
alertDialog.setMessage("Here is a really long message.");
alertDialog.setButton("OK", null);
AlertDialog alert = alertDialog.create();
alert.show();
谁能详细解释一下如何使它可滚动? 任何帮助或建议将不胜感激!
【问题讨论】:
-
阅读developer.android.com/reference/android/app/AlertDialog.html 如果您需要比文本更复杂的视图,则必须使用可滚动的 TextView 来做一些不同的事情,例如见http://stackoverflow.com/questions/1748977/making-textview-scrollable-in-android
-
这是不使用新布局的完美答案stackoverflow.com/a/33098898/2462531
标签: android android-alertdialog