Android: How to make all elements inside LinearLayout same size?

后端 未结 3 1259
离开以前
离开以前 2020-11-27 02:27

I would like to create a dialog to display a video title and tags. Below text I would like to add buttons View, Edit and Delete and make these elements same size. Does anyon

3条回答
  •  夕颜
    夕颜 (楼主)
    2020-11-27 03:19

    Use LinearLayout with your desired weightSum and create elements with equal layout_weight. Here is an example ...

    
    
        
    
        
    
        
    
        
    
        
    
    

    So, the weight sum of all elements is 5. Here is the screenshot ...

    enter image description here

    Note that, Google Material Design icons are used. Hope this is helpful.

提交回复
热议问题