开发者

How can I configure EditTextPreference to have scroll bar

In my android application, I have a EditTextPreference as one of my preferences in my PreferenceActivity. My question is how I can add a 'scroll bar' for the text of the EditText Preference? Sometime when the text is too long and when the 'soft keyboard' pops up, I don't see the buttons of the edit text dial开发者_运维百科og.

Thank you.


You can access the EditText of the EditTextPreference programmatically via getEditText() and then call setMovementMethod(new ScrollingMovementMethod()) on your EditText to make it scrollable.

Or you can set any EditText attributes on the EditTextPreference XML like android:scrollbars="vertical".

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜