哪种方式更好 app:layout_constraintStart_toStartOf 或 app:layout_constraintLeft_toLeftOf

Eri*_*Gil 3 xml user-interface android

我想知道是否

app:layout_constraintStart_toStartOf=""
Run Code Online (Sandbox Code Playgroud)

app:layout_constraintLeft_toLeftOf=""
Run Code Online (Sandbox Code Playgroud)

或Android 推荐使用任何人。

谢谢!

The*_*rer 5

那么你的用例是什么?

在 Android 中,start维度是在 I think Lollipop 中添加的。它基本上增加了对 RTL 语言的支持。对于世界大部分地区,LTR是默认的布局,所以startleft是一样的。

不过也有不少语言是读RTL的,比如阿拉伯语。重点start是让这些语言在您的应用程序中显示得更好(假设您已实现翻译)并与文本正确对齐。

如果您的应用程序仅用于,比如说,使用英语的设备,left现在完全没问题。如果你想制作一个面向大众的应用程序,并支持 RTL 语言,你应该使用start以避免不稳定的布局。