0
我想提出一个警告对话框中存在的警告对话框更多的文本的application.Because,我希望把垂直滚动条在dialog.I已经尝试了许多选项的警报,但没有什么是working.Please告诉我如何解决这个问题。这是代码:添加垂直滚动条到一个警告对话框
AlertDialog.Builder HelpOnButtonDialog ;
HelpOnButtonDialog = new AlertDialog.Builder(this);
TextView HelpOnButtonView = new TextView(this);
HelpOnButtonView.setSingleLine(false);
HelpOnButtonView.setTextColor(getResources().getColor(R.color.dark_green));
HelpOnButtonView.setText("hello");
Button HelpOnButton = new Button(this);
HelpOnButton.setHeight(20);
HelpOnButton.setWidth(20);
HelpOnButton.setText("Ok");
HelpOnButton.setOnClickListener(HelpOnButtonClickListener);
LinearLayout linearLayout = new LinearLayout(this);
linearLayout.setLayoutParams(new LinearLayout.LayoutParams(LinearLayout.LayoutParams.WRAP_CONTENT,
LinearLayout.LayoutParams.WRAP_CONTENT));
linearLayout.setOrientation(1);
linearLayout.setBackgroundColor(getResources().getColor(R.color.black));
linearLayout.addView(HelpOnButtonView);
linearLayout.addView(HelpOnButton);
ScrollView sv = new ScrollView(this);
sv.pageScroll(0);
sv.setBackgroundColor(0);
sv.setScrollbarFadingEnabled(true);
sv.setVerticalFadingEdgeEnabled(false);
sv.addView(linearLayout);
alertHelp = HelpOnButtonDialog.create();
alertHelp.setView(sv);
alertHelp.show();
如何滚动条的颜色设置? – NukeouT 2015-08-20 20:32:06