Why are nested weights bad for performance? Alternatives?

后端 未结 6 1601
深忆病人
深忆病人 2020-11-22 16:26

I have written a couple layout files where I used the layout_weight attribute to create a ratio between different views.

At some point, I start getting

6条回答
  •  半阙折子戏
    2020-11-22 16:50

    I think, the only alternative is to make a function that would be called onResume and will set all sizes and positions. Anyway, by weight you can set only sizes but no padding's (so layouts become even more complicated), no textSize's (impossible to compensate this somehow), let alone such things as number of lines.

提交回复
热议问题