删除按钮的额外空间有下面的按钮这个额外的空间,我不知道为什么会在那里。我尝试了一切,寻找有这种问题的人,可惜我什么也没找到。这是要么删除额外的空间和/或降低完美对齐。
这里是我的xml文件
<RelativeLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:id="@+id/button_layout"
android:layout_alignParentTop="true"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#262626"
android:gravity="center">
<Button
android:id="@+id/receipts_button"
android:background="@android:color/transparent"
android:drawableTop="@drawable/preview_save_icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button android:id="@+id/capture_button"
android:background="@android:color/transparent"
android:drawableTop="@drawable/preview_upload_icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
<Button android:id="@+id/settings_button"
android:background="@android:color/transparent"
android:drawableTop="@drawable/preview_discard_icon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"/>
</LinearLayout>
谢谢。这帮助我很多:) – kev
只是以防万一你还没有尝试它下面的RKN答案也会集中图标,但它也会拉伸它们来填充整个空间。你可以根据你想要的行为来玩弄背景和src。 – caiocpricci2