Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/linux/25.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中设计线性布局中的填充式格式?_Android - Fatal编程技术网

是否可以在Android中设计线性布局中的填充式格式?

是否可以在Android中设计线性布局中的填充式格式?,android,Android,当你有一个像填空这样的格式时,你怎么能在android中设计一个线性布局呢 <LinearLayout android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="horizontal" android:weightSum="3"> <TextView android:layout_width="168dp" android:layou

当你有一个像填空这样的格式时,你怎么能在android中设计一个线性布局呢

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<TextView
    android:layout_width="168dp"
    android:layout_height="40dp"
    android:textSize="25sp"
    android:text="@string/blank1first"
    android:id="@+id/blank1part"
    />
<EditText
    android:layout_width="68dp"
    android:layout_height="match_parent"
    android:id="@+id/blank1"
    android:textSize="25sp"
    android:text="dsasda" />
<TextView
    android:layout_width="match_parent"
    android:layout_height="86dp"
    android:text="@string/blank2first"
    android:textSize="20sp"/>


您只是缺少了
layout\u weight
属性:

<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal"
android:weightSum="3">
<TextView
    android:layout_width="0dp"
    android:layout_height="40dp"
    android:layout_weight="1"
    android:textSize="25sp"
    android:text="@string/blank1first"
    android:id="@+id/blank1part"
    />
<EditText
    android:layout_width="0dp"
    android:layout_height="match_parent"
    android:id="@+id/blank1"
    android:layout_weight="1"
    android:textSize="25sp"
    android:text="dsasda" />
<TextView
    android:layout_width="0dp"
    android:layout_height="86dp"
    android:layout_weight="1"
    android:text="@string/blank2first"
    android:textSize="20sp"/>
</LinearLayout>



你能解释一下“空白处的格式感觉”是什么吗?也许分享一个例子的链接是解释你的问题的最好方式。@NicolásCarrasco是一种常用的格式,在论文中使用。。
<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal"
    android:weightSum="3">

    <TextView
        android:layout_width="0dp"
        android:layout_height="40dp"
        android:layout_weight="1"
        android:textSize="25sp"
        android:text="@string/blank1first"
        android:id="@+id/blank1part"/>

    <EditText
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:id="@+id/blank1"
        android:textSize="25sp"
        android:text="dsasda" />

    <TextView
        android:layout_width="0dp"
        android:layout_height="86dp"
        android:layout_weight="1"
        android:text="@string/blank2first"
        android:textSize="20sp"/>