Replacement for the linearLayout weights mechanism

前端 未结 4 1953
渐次进展
渐次进展 2021-02-02 13:15

Background:

  • Google suggests to avoid using nested weighted linearLayouts because of performance.
  • using nested weighted linearLayout is awful to read, writ
4条回答
  •  孤街浪徒
    2021-02-02 14:06

    Now there is a nicer solution than the custom layout I've made:

    PercentRelativeLayout

    Tutorial can be found here and a repo can be found here.

    Example code:

    
         
     
    

    or:

     
         
     
    

    I wonder though if it can handle the issues I've shown here.

提交回复
热议问题