Android 具有多个按钮和视图的活动布局集
我想创建一个由许多按钮和编辑文本组成的活动。 第一行有5个按钮(等距且尺寸相同), 第二行有两个按钮(1/4和3/4是相对尺寸) 第三行(最大的一行)分为两列: 在左边,我只是以编程方式添加了一些EditExt,在右边Android 具有多个按钮和视图的活动布局集,android,button,layout,view,Android,Button,Layout,View,我想创建一个由许多按钮和编辑文本组成的活动。 第一行有5个按钮(等距且尺寸相同), 第二行有两个按钮(1/4和3/4是相对尺寸) 第三行(最大的一行)分为两列: 在左边,我只是以编程方式添加了一些EditExt,在右边 我有三个大按钮。我应该使用哪一组布局来创建这样的活动?这看起来像一个线性布局,因为使用这些布局,您可以相当容易地获得前两行 像这样的 <LinearLayout android:layout_width="match_parent" android:orie
我有三个大按钮。我应该使用哪一组布局来创建这样的活动?这看起来像一个线性布局,因为使用这些布局,您可以相当容易地获得前两行 像这样的
<LinearLayout
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_weight=".2"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_weight=".2"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_weight=".2"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_weight=".2"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_weight=".2"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_weight=".25"
android:layout_height="wrap_content"/>
<Button
android:layout_width="wrap_content"
android:layout_weight=".75"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:layout_width="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</LinearLayout>
<LinearLayout
android:layout_width="wrap_content"
android:layout_weight="1"
android:orientation="vertical"
android:layout_height="wrap_content">
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
</LinearLayout>
</LinearLayout>
</LinearLayout>