Android Question EditText appears to truncate top of text.

Gavin

Member
Licensed User
Longtime User
Hi Everyone
As I enter text in an EditText View, the top of the text is truncated. This ocures while running the program on a Samsung GT-S7500T. If I run the same program on my Nexus 7, everything is fine, the text appears correctly in the center of the EditView. Now, I know that the requirements to scale text for different devices are different than that for views. (buttons, panels, ect) In the example uploaded, I would have thought I could use a Text Size of, say 14 or 16 and have the text display properly in the EditText. I found I had to reduce the size to 10 to have all the text visible but even then, the text shows a bias towards to top of the EditText. Even remming out the EditText.TextSize produces the truncation. What am I doing wrong?
This example simulates the way the EditText will used it the project.
 

Attachments

  • ET_Example.zip
    6.6 KB · Views: 151

Gavin

Member
Licensed User
Longtime User
Thank you Erel
I will take you advice and redo the ScrollView using the designer.
The upper 9x9 grid (not shown in sample) should run fine on all devices as the view is square and I am only using %x.
Will check out SubSetpadding.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
hi Gavin .. on a side note , unsure if you purposely coded your button creation that way for the example, but if not, it could be trimmed to ...

B4X:
Dim btnPanel(4) As Panel
For i = 0 To 3
  btnPanel(i).Initialize("btnPanel")
  svButtons.Panel.AddView(btnPanel(i), 3.5%x, 1dip + i*PanelHeight, 93%x,PanelHeight)
  btnPanel(i).Tag = i
Next
   
 btnPanel(0).Color=Colors.Red
 btnPanel(1).Color=Colors.Green
 btnPanel(2).Color=Colors.Yellow
 btnPanel(3).Color=Colors.Magenta

Cheers from W.A.
 
Upvote 0
Top