在使用XML创建复杂UI时,建议避免嵌套视图(RelativeLayout
和LinearLayout
),并鼓励使用ConstraintLayout
实现复杂布局。
现在有了Compose,仅凭外观看,Compose中的ConstraintLayout
很难理解,从我的角度来看,使用ConstraintLayout
比嵌套Column
和Row
花费更多时间去思考视图应该是什么样子的。
老实说,我宁愿使用嵌套Column
和Row
而不是Compose中的ConstraintLayout
,但我不确定它的缺点是什么。