是否可以在Android中设计线性布局中的填充式格式?
当你有一个像填空这样的格式时,你怎么能在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
<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"/>