Android Question SwiftButton position

angel_

Active Member
Licensed 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

Mahares

Well Known Member
Licensed 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"
 

angel_

Active Member
Licensed 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
 
Top