2
我会让有70%的宽度的视图,并使用约束布局对齐到其父的权利,遵循约束布局有个工作不正常
<android.support.constraint.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
>
<android.support.constraint.Guideline
android:id="@+id/guideline"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
app:layout_constraintGuide_percent="0.3"/>
<TextView
android:layout_width="match_parent"
android:layout_height="40dp"
android:text="Hello text"
app:layout_constraintLeft_toRightOf="@+id/guideline"
app:layout_constraintRight_toRightOf="parent"/>
</android.support.constraint.ConstraintLayout>
TextView的始终占据全父宽度。任何想法我做错了什么?