在下面的佈局中,我希望version_label
和installed_label
縮進10個空格。 這是如何在ConstraintLayout中完成的?如何在ConstraintLayout中縮進?
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/constraintLayout"
android:layout_width="match_parent"
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/about_app_name"
android:text="@string/app_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textStyle="bold"
android:textColor="@color/orange"
android:textSize="@dimen/text_size_xl"
tools:layout_editor_absoluteX="0dp"
app:layout_constraintStart_toStartOf="@+id/constraintLayout"
app:layout_constraintTop_toTopOf="parent"/>
<TextView
android:id="@+id/version_label"
android:text="Version: "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="0"
android:textColor="@color/black"
android:textSize="@dimen/text_size_large"
app:layout_constraintStart_toStartOf="@+id/constraintLayout"
app:layout_constraintTop_toBottomOf="@+id/about_app_name"
tools:layout_editor_absoluteX="0dp" />
<TextView
android:id="@+id/version_number"
android:text="@string/text_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="0"
android:textColor="@color/black"
android:textSize="@dimen/text_size_large"
app:layout_constraintStart_toEndOf="@+id/last_update_label"
app:layout_constraintTop_toBottomOf="@+id/about_app_name"
tools:layout_editor_absoluteX="166dp" />
<TextView
android:id="@+id/installed_label"
android:text="Installed: "
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="0"
android:layout_row="1"
android:textColor="@color/black"
android:textSize="@dimen/text_size_large"
app:layout_constraintStart_toStartOf="@+id/constraintLayout"
app:layout_constraintTop_toBottomOf="@+id/version_label"
tools:layout_editor_absoluteX="0dp" />
<TextView
android:id="@+id/install_date"
android:text="@string/text_version"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_column="1"
android:layout_row="1"
android:textColor="@color/black"
android:textSize="@dimen/text_size_large"
app:layout_constraintStart_toEndOf="@+id/last_update_label"
app:layout_constraintTop_toBottomOf="@+id/version_label"
tools:layout_editor_absoluteX="166dp" />
</android.support.constraint.ConstraintLayout>
10個空格?你什麼意思? – Divers
你有沒有試過填充或邊距?即使在ConstraintLayout中,TextView也是textviews。 –
對不起10 px我認爲這是正確的說法。 –