此代码生成多行EditText。提示大于EditText。当我使用手指手势时,我希望提示能够垂直滚动,这样我才能看到整个提示..
当我打字足以填充EditText时,会滚动。
EditText bottomT = new EditText(context);
bottomT.setTextSize(28);
bottomT.setHint("A whole bunch of information....");
bottomT.setHintTextColor(grayDarkColor);
bottomT.setPadding(10, 0, 10, 0);
bottomT.setBackgroundColor(grayLightColor);
bottomT.setGravity(Gravity.TOP);
bottomT.setTextColor(grayDarkColor);
bottomT.setText("", TextView.BufferType.EDITABLE);
bottomT.setWidth(250);
bottomT.setHeight(200);
bottomT.setScroller(new Scroller(model)); // DOESN'T HELP
bottomT.setHorizontallyScrolling(false);
bottomT.setInputType(InputType.TYPE_CLASS_TEXT | InputType.TYPE_TEXT_FLAG_MULTI_LINE);
bottomT.setMovementMethod(new ScrollingMovementMethod()); // DOESN'T HELP
答案 0 :(得分:0)
使用此代码
questionEntry.setScroller(new Scroller(myContext));
questionEntry.setMaxLines(1);
questionEntry.setVerticalScrollBarEnabled(true);
questionEntry.setMovementMethod(new ScrollingMovementMethod());