How to put 50% for width

前端 未结 4 2036
野的像风
野的像风 2021-01-18 01:24

I have a LinearLayout in horizontal orientation and 2 ImageView and I want to make that ImagesView fill 50% of the screen on width, to work in every cellphone or tablet with

4条回答
  •  离开以前
    2021-01-18 01:38

    Write following code to do that in both views inside LinearLayout.

    android:layout_width="0dp"
    layout_weight="1"
    

提交回复
热议问题