I am using and EditText to display my app's EULA. The EditText is marked singleLine=false and enabled = false.
When I ev.setText='....', the text appears slightly shifted 1 and 1/2 characters to the left plus down 1 and 1/2 lines. That is, the text is not registered/displayed properly to the top left corner. Any ideas?
Why an EditText? Seems like a TextView would be the more proper vehicle to display that.
As for the text position, it sounds like you have padding (or margins, or both) specified in the XML.
The following code works:
myEtLoginEula.setEnabled(false);
myEtLoginEula.setVisibility(View.VISIBLE);
myEtLoginEula.setText(myJS.getString("EULAText").replace("<br>","\n") + "\n");
myEtLoginEula.setScroller(new Scroller(getBaseContext()));
myEtLoginEula.setVerticalScrollBarEnabled(true);
myEtLoginEula.setMovementMethod(new ScrollingMovementMethod());
I was previously setting the text, .setText(myJS...)
after the .setMovementMethod
. It does not like that. I had originally obtained all this months back from another SO question regarding scrolling. Seems to work now. I will revisit TextView
instead of EditText
as well. Thanks for your patience as I am newbie to SO responding!