在 Android ConstraintLayout 中,tools:layout_constraintTop_creator 属性有什么用?
In an Android ConstraintLayout, what is the tools:layout_constraintTop_creator attribute for?
在此代码段中,将 tools:layout_constraintTop_creator
属性设置为“1”是什么意思?
<TextView
android:text="@string/passenger_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textViewPassengerLabel"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:letterSpacing="0.5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
tools:layout_constraintTop_creator="1"
tools:layout_constraintLeft_creator="1" />
正如命名空间所暗示的(工具:layout_constraintTop_creator),它纯粹由 Android Studio 使用——这些属性(使用命名空间工具)实际上在 xml文件被推送到设备上。
所以不应该使用它:)
现在,如果您想知道 Studio 如何使用这些,其实很简单:我们使用创建者属性来跟踪约束的创建者,特别是如果它们是由推理引擎创建的,因为我们想废弃它们/ 在某些情况下替换它们。
在此代码段中,将 tools:layout_constraintTop_creator
属性设置为“1”是什么意思?
<TextView
android:text="@string/passenger_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/textViewPassengerLabel"
android:textAppearance="@style/TextAppearance.AppCompat.Caption"
android:letterSpacing="0.5"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:layout_marginStart="16dp"
android:layout_marginTop="16dp"
android:layout_marginLeft="16dp"
tools:layout_constraintTop_creator="1"
tools:layout_constraintLeft_creator="1" />
正如命名空间所暗示的(工具:layout_constraintTop_creator),它纯粹由 Android Studio 使用——这些属性(使用命名空间工具)实际上在 xml文件被推送到设备上。
所以不应该使用它:)
现在,如果您想知道 Studio 如何使用这些,其实很简单:我们使用创建者属性来跟踪约束的创建者,特别是如果它们是由推理引擎创建的,因为我们想废弃它们/ 在某些情况下替换它们。