我已将按钮修改为看起来像个微调框。在AVD和图形布局上,它看起来似乎像微调框,但在我的手机上,看上去却完全不同。

AVD上的按钮:



我手机上的按钮:

有人可以告诉我为什么会这样吗?

这是XML中的Button布局:

<Button
    android:id="@+id/datebutton"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="20dp"
    android:hint="@string/datebuttontxt"
    android:onClick="datepicker"
    android:gravity="center"
    style="@android:style/Widget.DeviceDefault.Light.Spinner" />


将按钮背景更改为不可见没有帮助。
另外,如果我使用实际的微调器,它将正确显示,就像它在AVD上显示的一样。

最佳答案

Widget.DeviceDefault.X样式在不同设备之间变化,请使用@android:style/Widget.Holo.X样式获得一致的外观。
在您的情况下:

@android:style/Widget.Holo.Light.Spinner

10-07 19:32
查看更多