0

アプリに垂直方向を使用しています。しかし、1行に複数のフィールドを表示したいと思います。出来ますか?ボタンを1列ではなく1行で表示したい。

画像内のボタンは、1列に1つずつ配置されます。 一列に並べる必要があります。

<Button
android:id="@+id/bMultiply"
android:layout_width="wrap_content"
android:layout_height="0dp"
android:layout_weight="1"
android:onClick="addMultiply"
android:text="@string/bMultiply" />

activity_Calc_main.xmlのボタン構成のサンプル

4

3 に答える 3

1

あなたはこのようなことを試すことができます:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
                 android:orientation="vertical">

    <TextView ....
    <TextView   .....

    <LinearLayout 
        android:orientation="horizontal" >

    <Button ...
    <Button ...
    <Button ...
    <Button ...

    </LinearLayout>
</LinearLayout>
于 2013-03-20T14:15:19.260 に答える
1

次のことを行います

<LinearLayout
     android:orientation="vertical" >
     // add other elements on top of the buttons
     <LinearLayout
         android:orientation="horizontal" >
         //add buttons here

     </LinearLayout>

     // add other elements on bottom of the buttons
</LinearLayout>
于 2013-03-20T14:18:56.243 に答える
1
<LinearLayout ...
    android:orientation="vertical">
 <EditText...../>
 <EditText...../>
 <LinearLayout ...
    android:orientation="horizontal"> <-----

    <Button.../>
    <Button.../>
    <Button.../>
    <Button.../>

 </LinearLayout>

</LinearLayout>
于 2013-03-20T14:19:45.597 に答える