Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/191.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何使用ConstraintLayout';布局行中元素的确切数量;s流_Android_Android Constraintlayout - Fatal编程技术网

Android 如何使用ConstraintLayout';布局行中元素的确切数量;s流

Android 如何使用ConstraintLayout';布局行中元素的确切数量;s流,android,android-constraintlayout,Android,Android Constraintlayout,我需要布局几对title-value小部件,每对小部件位于一行中,标题与父项的开始对齐,值与父项的结束对齐 项目托管在ConstraintLayout中,我希望使用Flow以所需的方式对齐它们。 我尝试使用Flow的应用程序:Flow\u wrapMode=“aligned”,但这还不够,因为我需要将每个标题都放在一行中。我需要的是一个Flow\u maxementswrap属性: <androidx.constraintlayout.helper.widget.Flow androi

我需要布局几对title-value小部件,每对小部件位于一行中,标题与父项的开始对齐,值与父项的结束对齐

项目托管在ConstraintLayout中,我希望使用Flow以所需的方式对齐它们。
我尝试使用Flow的
应用程序:Flow\u wrapMode=“aligned”
,但这还不够,因为我需要将每个标题都放在一行中。

我需要的是一个
Flow\u maxementswrap
属性:

<androidx.constraintlayout.helper.widget.Flow
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  app:layout_constraintEnd_toEndOf="parent"
  app:layout_constraintStart_toStartOf="parent"
  app:constraint_referenced_ids="amountTitle,amount,deliveryTitle,delivery"
  app:flow_horizontalStyle="spread_inside"
  app:flow_maxElementsWrap="2"
  app:flow_wrapMode="aligned" />

<TextView
  android:id="@+id/amountTitle"
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:text="@string/amount_title" />

<TextView
  android:id="@+id/amount"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="$3.00" />

<TextView
  android:id="@+id/deliveryTitle"
  android:layout_width="0dp"
  android:layout_height="wrap_content"
  android:text="@string/delivery_title" />

<TextView
  android:id="@+id/delivery"
  android:layout_width="wrap_content"
  android:layout_height="wrap_content"
  android:text="$1.00" />