EditText displays text slightly off?

Go To StackoverFlow.com

0

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?

2012-04-04 18:33
by Ron Thomas
Can we see the XML and some code - Jared Burrows 2012-04-05 01:09


0

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.

2012-04-05 04:18
by Barak
The XML is: Ron Thomas 2012-04-05 04:21


0

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 TextViewinstead of EditTextas well. Thanks for your patience as I am newbie to SO responding!

2012-04-05 04:25
by Ron Thomas
Ads