图像按钮图标未出现在某些Android设备上

图像按钮图标未出现在某些Android设备上,android,android-imagebutton,Android,Android Imagebutton,在我的Android应用程序中,我添加了以下图像按钮: <ImageButton android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/ic_play_circle_filled_black_24dp" android:background="@null"

在我的Android应用程序中,我添加了以下图像按钮:

<ImageButton
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:src="@drawable/ic_play_circle_filled_black_24dp"
            android:background="@null"
            android:id="@+id/soundButton"

            android:layout_alignParentRight="true"
            android:visibility="visible" />


在emulator和我的Nexus4上测试时,它工作正常。但当我试着在其他手机上测试时,它就是不出现。为什么?

您可以尝试将图像文件复制到app/src/main文件。Android studio制作不同大小的图像以适应不同的屏幕。正如胡安·克鲁兹·索勒(Juan Cruz Soler)所说,可能发生的情况是,图像太大,无法显示。

可能没有足够的空间在某些屏幕上显示它。你能发布整个布局吗?当渲染代码看起来很好时,它可能会失望。可能是布局渲染issue@OussemaAroua那么如何修复它呢?尝试更改视图的高度和宽度以进行测试,并定位中心