Android Question Padding an edittext?

U

unba1300

Guest
Is it possible to add padding at the end of an edittext?

My edittexts look like torn pieces of paper and I'd like to add a pushpin (PNG image) near the right edge, but it currently covers the text, so that's why I'm wondering about padding or something. I don't think limiting the number characters would work because that would vary too much between different devices. Thanks.
 
U

unba1300

Guest
Thank you.
I padded the edittexts on the right edge the same width as an enabled, but transparent, label, and have the labels' click event change the position a pushpin to match. Looks and feels quite nice.
 
Upvote 0

mangojack

Expert
Licensed User
Longtime User
Try this .. requires reference to JavaObject library.

B4X:
Sub  DoPadding
   
   For i = 0 To Activity.NumberOfViews - 1
   
     If Activity.GetView(i) Is Button Then

       Dim b As Button
       b = Activity.GetView(i)

       Dim jo As JavaObject = b
       jo.RunMethod("setPadding", Array As Object(0, 0, 0, 10))

  End If

  Next
   
End Sub
 
Upvote 0
Top