Assign width to half available screen width declaratively

前端 未结 5 2162
北恋
北恋 2020-11-28 23:43

Is it possible to assign a widget width to half the available screen width, and do it using declarative xml?

5条回答
  •  独厮守ぢ
    2020-11-29 00:15

    give width as 0dp to make sure its size is exactly as per its weight this will make sure that even if content of child views get bigger, they'll still be limited to exactly half(according to is weight)

    
    
        

提交回复
热议问题