我有以下按钮:

<Button
    android:layout_height="32dp"
    android:layout_marginTop="4dp"
    android:layout_marginLeft="@dimen/aecs_item_inner_padding_positive"
    android:id="@+id/aecsTelephone"
    android:layout_width="wrap_content"
    android:layout_gravity="center_horizontal"
    android:layout_below="@id/aecsServicesContainer"
    android:layout_alignParentLeft="true"
    android:text="Mobile"
    android:background="@drawable/selector_mobile_button" />

它有以下背景选择器:
<?xml version="1.0" encoding="utf-8"?>

<selector xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:drawable="@drawable/mobile_btn_pressed" android:state_pressed="true"></item>
    <item android:drawable="@drawable/mobile_btn"></item>
</selector>

在棒棒糖只有背景显示一个椭圆形的灰色层,我没有任何线索从何处显示这个层?
请注意,使用无9补丁版本的图像修复问题,但我不知道为什么!
移动9.png
棒棒糖截图:
Kitkat截图:
编辑:
问题解决了。好吧..它是在9补丁图像的透明度中,我从hdpi文件夹中使用它,当它被缩放时,透明度区域会被破坏。然而,我仍然感到震惊的是,为什么这个问题只出现在棒棒糖上。在我使用图像后,它是没有任何规模的问题是固定的。

最佳答案

如果不需要默认的样式,请使用TextView并设置android:focusable="true"Button小部件只是Button上的一小部分属性,包括默认的高度和z深度动画。

08-18 05:30