Adjust width to half screen

前端 未结 5 2012
再見小時候
再見小時候 2021-01-05 05:27

I came across this link :

Assign width to half available screen width declaratively

How to do the same in relative layout? Here\'s the code: Trying linea

5条回答
  •  忘掉有多难
    2021-01-05 06:09

    This is a nice workaround if you precisely need half, when using RelativeLayout. What you do is, make a fake invisible view centered in parent, and have left button be alignParentLeft and alignRight to that fake view and the right button vice-versa

    
    
       
       

    Its really clever.

提交回复
热议问题