我已创建自定义按钮,并把它夹在抽拉文件夹中,代码如下它:减少自定义按钮尺寸
<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