LinearLayout with two children of equal width

后端 未结 5 563
北荒
北荒 2021-01-17 11:26

I\'m having some issues getting two children of a LinearLayout to have the same width. This is what I am getting:

5条回答
  •  -上瘾入骨i
    2021-01-17 11:58

    android:weightSum="2" should be on the parent of the two children ImageViews, not on the upper parent. Or else try to set weightsas 0.5 and see if it works.

    Also, the widths of the two image views should be android:layout_width="0dp" when using weights like this.

    Next, scale up your images to fill space. Details here.

提交回复
热议问题