Android Checkbox按钮图像无法正确包装内容

时间:2013-06-05 07:31:19

标签: android android-layout android-xml

嗨我正在为我的项目做一个布局,我需要一个播放按钮的复选框,在点击时会变成一个暂停按钮,所以我使用了一个选择器,这个是

pause_play_selector.xml

<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_checked="true" android:drawable="@drawable/pause" />
    <item android:state_checked="false" android:drawable="@drawable/play"/>
    <item android:drawable="@drawable/play"/>
</selector>

这是我的Checkbox xml

<CheckBox
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:id="@+id/play_pauseBtn"
            android:button="@drawable/pause_play_selector" android:checked="false"/>

在设计器部分中查看时,显示的复选框显示的所有图像都很好,但在我将其安装到我的设备后,只有一半显示。

这是截图:

在布局编辑器上

enter image description here

在我的设备上看到修剪后的播放按钮:

enter image description here

有没有人在这里过时了?解决这个问题的任何方法?

0 个答案:

没有答案