【发布时间】:2017-11-21 09:05:21
【问题描述】:
如何从按钮中删除这些边距?
https://i.stack.imgur.com/UBPhR.png
我想要 100% 宽度的按钮:/
我的活动 xml:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="0dp"
tools:context="${relativePackage}.${activityClass}" >
<Button
android:id="@+id/button1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_marginBottom="34dp"
android:backgroundTint="#1379ff" />
<Button
android:id="@+id/Button01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:backgroundTint="#313131" />
android:layout_alignParentLeft="true"
android:layout_weight="1"
android:text="Button" />
【问题讨论】:
-
发布您的代码?
-
在您的布局中,您可能指定了默认边距删除它们
-
能否请您也发布您的xml
-
我已将我的 xml 添加到帖子中
-
你的代码完整吗?
标签: java android xml button margin