ConstraintLayout 功能强大,但有时也很棘手。
我想实现一个布局ConstraintLayout,可以通过LinearLayout.
蓝色区域是父约束布局。红色部分是LinearLayout。我想通过保持以下条件将此 LinearLayout 转换为 ConstraintLayout
红框应该保持不变wrap_content。

我曾尝试使用障碍、指南和约束布局的其他属性,但没有成功。
这是代码LinearLayout:
<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="match_parent"
android:background="#476dce"
android:padding="16dp">
<LinearLayout
android:orientation="vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
android:background="#f5aaaa">
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
tools:text="Small" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
tools:text="Bigggggeer" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Button"
tools:text="Even Bigggggggggeer" />
</LinearLayout>
</android.support.constraint.ConstraintLayout>
Run Code Online (Sandbox Code Playgroud) 我想创建一个布局(使用约束布局),如下所示:
在不同的语言中,Button1 可能比 button2 大。我怎样才能做到这一点?
我只能在包含两个按钮的约束中使用 LinearLayout 来实现这一点,但我试图只使用一个布局。
谢谢