2015-12-12 105 views
0

此代碼會產生多行EditText。提示比EditText大。我想,當我用手指手勢暗示垂直滾動,所以我可以看到整個提示..Android EditText提示不垂直滾動

enter image description here

當我鍵入足以填充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

使用此代碼

questionEntry.setScroller(new Scroller(myContext)); 
questionEntry.setMaxLines(1); 
questionEntry.setVerticalScrollBarEnabled(true); 
questionEntry.setMovementMethod(new ScrollingMovementMethod()); 
+0

這並沒有解決問題,這是爲了能夠使用手指手勢來滾動。 –