我已創建自定義按鈕,並把它夾在抽拉文件夾中,代碼如下它:減少自定義按鈕尺寸
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#f50057" />
<padding
android:left="30dp"
android:top="0dp"
android:right="30dp"
android:bottom="0dp" />
<corners android:radius="5dp" />
</shape>
我使用上述作爲背景的按鈕,該按鈕被佔用過多空間垂直事件雖然我已經把它填充爲0dp。你能幫我減少按鈕垂直佔用的空間嗎?
代碼佈局:
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/start_button"
android:background="@drawable/myrect"
android:focusable="false"
android:text="Start"
android:layout_below="@+id/expandview"
android:layout_centerHorizontal="true" />
變化機器人:layout_height = 「WRAP_CONTENT」 用固定值(EXP:機器人:layout_height = 「48dp」) – Rami 2014-12-03 07:05:04
'機器人:layout_height = 「10dp」'Ñ嘗試 – 2014-12-03 07:06:57
PLZ檢查此鏈接-http:/ /stackoverflow.com/questions/4361309/remove-space-between-buttons。我認爲有幫助 – Sanket990 2014-12-04 05:44:39