Android Question Centre a row of views

Sanxion

Active Member
Licensed User
Longtime User
Hi all

I have a 2 image views and 2 spinners on a single 'row'. Does anybody have a script to position all 4 views in the Activity so they appear side by side and with a small space between them?

Thanks
 

Cableguy

Expert
Licensed User
Longtime User
The easiest is to place them inside a Panel and use anchor in the views, and then it will be just the panel that needs to be centred!
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
B4X:
offset=100%x/4
size=offset-5%x

img1.left=0
img1.width=size
spinner1.left=offset
spinner1.width=size
img2.left=offset*2
img2.width=size
spinner2.left=offset*3
spinner2.width=size
 
Upvote 0
Top