Android 在ConstraintLayout中,我们使用';app&x27;在RelativeLayout中,我们使用';安卓&x27;。为什么?

Android 在ConstraintLayout中,我们使用';app&x27;在RelativeLayout中,我们使用';安卓&x27;。为什么?,android,android-layout,android-relativelayout,android-constraintlayout,Android,Android Layout,Android Relativelayout,Android Constraintlayout,在使用Android Studio时,我遇到了约束布局。我使用下面提到的链接来了解它: 但我还有一个小问题。在RelativeLayout中,我们使用了android:layout\u alignParentBottom,android:layout\u alignParentTop,等等。它们都是从android开始的。但在ConstraintLayout中,我们必须使用app:layout\u constraintLeft\u toRightOf等 你能解释一下使用app和android前

在使用Android Studio时,我遇到了约束布局。我使用下面提到的链接来了解它:

但我还有一个小问题。在RelativeLayout中,我们使用了
android:layout\u alignParentBottom
android:layout\u alignParentTop
,等等。它们都是从
android
开始的。但在ConstraintLayout中,我们必须使用
app:layout\u constraintLeft\u toRightOf


你能解释一下使用
app
android
前缀的区别及其重要性吗?

android
通常用于来自android SDK本身的属性

如果您正在使用支持库,则通常会使用
app


ConstraintLayout是支持库中提供的新布局。因此使用“应用程序”

,因为约束布局是支持库的一部分,所以必须单独添加其支持的资源值。请参见以下链接。我希望有帮助。