【问题标题】:In ConstraintLayout, we use 'app' while in RelativeLayout, we use 'android'. Why?在 ConstraintLayout 中,我们使用“app”,而在 RelativeLayout 中,我们使用“android”。为什么?
【发布时间】:2017-06-13 12:33:53
【问题描述】:

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

https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html#RelativePositioning

但我还有一个小问题。在RelativeLayout中,我们使用android:layout_alignParentBottom、android:layout_alignParentTop等,它们都以android开头。但是在ConstraintLayout中,我们必须使用app:layout_constraintLeft_toRightOf等。

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

【问题讨论】:

标签: android android-layout android-relativelayout android-constraintlayout


【解决方案1】:

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

app 在使用支持库时经常使用。

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

【讨论】:

    猜你喜欢
    • 2020-04-14
    • 2023-01-10
    • 1970-01-01
    • 2018-03-19
    • 1970-01-01
    • 2011-02-05
    • 1970-01-01
    • 1970-01-01
    • 2014-06-20
    相关资源
    最近更新 更多