当图像处于相对布局时,我无法看到图像按钮的图像。如果我使用不同的布局,图像工作正常。 我的布局如下:相对布局中的图像按钮android not shown the image
<?xml version="1.0" encoding="utf-8"?>
<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="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
android:paddingBottom="@dimen/activity_vertical_margin">
<android.support.v7.widget.RecyclerView
android:id="@+id/cardList"
android:layout_width="match_parent"
android:layout_height="match_parent"
/>
<ImageButton
android:layout_width="56dp"
android:layout_height="56dp"
android:src="@drawable/plus"
android:layout_alignParentBottom="true"
android:layout_alignParentRight="true"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
android:id="@+id/fab"
android:elevation="1dp"
/>
</RelativeLayout>
相同的图像,如果我在其他一些布局设置的东西做工精细。任何人都可以给我一些指引,看看哪里。 日志中没有错误或警告。 实际png图片如下:
你想实现浮动按钮? – 2015-03-02 09:47:30
是试验浮动按钮。 – Thebestshoot 2015-03-02 09:51:24
您可以使用框架布局。 – 2015-03-02 10:17:28