我用這個代碼繪製以下行如何按鈕之間設置空間,使文本在一行
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_weight=".25"
android:layout_height="fill_parent"
android:orientation="horizontal"
>
<Button
android:id="@+id/Chemo"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="Chemo"
android:background="@drawable/firstbuttoncolorstyle"
android:textColor="@drawable/firstbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/inpatient"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="inpatient"
android:background="@drawable/firstbuttoncolorstyle"
android:textColor="@drawable/firstbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/Mgmt"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="Mgmt"
android:background="@drawable/firstbuttoncolorstyle"
android:textColor="@drawable/firstbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight=".25"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/PFinder"
android:layout_width="match_parent"
android:layout_weight="0.23"
android:layout_height="wrap_content"
android:text="Patient"
android:background="@drawable/secondbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/Afinder"
android:layout_width="match_parent"
android:layout_weight="0.23"
android:layout_height="wrap_content"
android:text="Appointement"
android:background="@drawable/secondbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/Calender"
android:layout_width="match_parent"
android:layout_weight="0.23"
android:layout_height="wrap_content"
android:text="Calender"
android:background="@drawable/secondbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_weight=".25"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<Button
android:id="@+id/Profile"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="Profile"
android:background="@drawable/thirdbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/Clear"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="Clear"
android:background="@drawable/thirdbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
<Button
android:id="@+id/Logout"
android:layout_width="match_parent"
android:layout_weight="0.33"
android:layout_height="wrap_content"
android:text="Logout"
android:background="@drawable/thirdbuttoncolorstyle"
android:textColor="@drawable/secondbuttontextstyle"
android:layout_gravity="center"
android:textSize="22dp"
/>
</LinearLayout>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_weight="0.25"
android:layout_height="wrap_content"
android:orientation="horizontal"
>
<ImageButton
android:id="@+id/maillme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/mail"
android:layout_gravity="center"
/>
<ImageButton
android:id="@+id/callme"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/call"
android:layout_gravity="center"
/>
</LinearLayout>
</LinearLayout>
但下面是輸出
如何在按鍵之間設置空間,使例如,在一個行壓延字
問候