开发者

android app: aligning imageviewS in center horizontally

开发者 https://www.devze.com 2023-01-08 11:44 出处:网络
So I\'m messing with imageviews and I am able to align a singl开发者_运维技巧e imageview in the center horizontally with the following code:

So I'm messing with imageviews and I am able to align a singl开发者_运维技巧e imageview in the center horizontally with the following code:

android:layout_centerHorizontal="true"

Now my main problem is that I have X imageviews and when I align them all like that and then use the android:layout_toRightOf="", they just start from the middle.

What to do?


Wrap them in a horizontal LinearLayout that is centred in your RelativeLayout


a fast solution you will align the first to the left then the next imageviews toRightOf= (delete android:layout_centerHorizontal="true" from your layout)

0

精彩评论

暂无评论...
验证码 换一张
取 消