Android Question SwiftButton position

angel_

Well-Known Member
Licensed User
Longtime User
I can't center the position and text in a SwiftButton, I'm using this code:

B4X:
Dim xBtn As SwiftButton

xBtn.mBase.Height = alto
xBtn.mBase.Width = ancho
xBtn.mBase.Top = top
xBtn.mBase.Left = izq
 

Attachments

  • Capture.jpg
    8.5 KB · Views: 255

Mahares

Expert
Licensed User
Longtime User
I tried it, but it doesn't work
You do not show any code on how you got the icon in the button text. If you used CSBuilder, it has an alignment member. I used the above code I posted on a pure text and it centered the text for me: btn.text="Test"
 
Upvote 0

angel_

Well-Known Member
Licensed User
Longtime User
The designer is great but sometimes when I'm trying out which is the most suitable position and dimensions for the view find it more comfortable to do it with code, especially when the number of views is high
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…