Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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/5/objective-c/26.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 Studio将元素与它们下面的其他元素对齐_Android_Xml_Android Layout - Fatal编程技术网

Android Studio将元素与它们下面的其他元素对齐

Android Studio将元素与它们下面的其他元素对齐,android,xml,android-layout,Android,Xml,Android Layout,您好,我正在使用android studio开发移动应用程序,我需要制作3个相同大小的LinearLayouts。问题是第一个元素包含不同的元素。我需要拉伸第一个元素,使其与其他元素的大小完全相同。我想我可以通过某种方式知道这是元素的大小,并将值设置为第一个元素。也许有可能以某种方式将它们对齐?这就是它的样子。谢谢你的帮助 按如下方式创建第一个元素: <TextView style="@style/option_type_text" android:l

您好,我正在使用android studio开发移动应用程序,我需要制作3个相同大小的
LinearLayouts
。问题是第一个元素包含不同的元素。我需要拉伸第一个元素,使其与其他元素的大小完全相同。我想我可以通过某种方式知道这是元素的大小,并将值设置为第一个元素。也许有可能以某种方式将它们对齐?这就是它的样子。谢谢你的帮助


按如下方式创建第一个元素:

<TextView
    style="@style/option_type_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/rounds" />
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:gravity="center">

    <Button
        android:id="@+id/minus_round_button"
        style="@style/change_value_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/minus" />

    <EditText
        android:id="@+id/round_minutes"
        style="@style/option_input_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/default_time" />
    
    <Button
        android:id="@+id/plus_round_button"
        style="@style/change_value_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/plus"/>
</LinearLayout>


它不工作。它将第一个元素拉伸到屏幕的大小:/尝试在“设计”选项卡中扩展它,或者在“圆形”中添加:00
<TextView
    style="@style/option_type_text"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="@string/rounds" />
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:gravity="center">

    <Button
        android:id="@+id/minus_round_button"
        style="@style/change_value_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/minus" />

    <EditText
        android:id="@+id/round_minutes"
        style="@style/option_input_text"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:text="@string/default_time" />
    
    <Button
        android:id="@+id/plus_round_button"
        style="@style/change_value_button"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/plus"/>
</LinearLayout>