【问题标题】:Android spinnerStyle not workingAndroid spinnerStyle 不起作用
【发布时间】:2013-09-06 19:12:11
【问题描述】:

首先对不起我的英语。

我正在设计一个主题(使用 HoloEveryWhere)并尝试设置默认微调器的样式。

问题是 spinnerStyle 不起作用。我正在测试这个布局。

            <Spinner
                android:id="@+id/spCountry"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_below="@id/etPhone" />

我将它用于我的 theme.xml..

 <item name="android:spinnerStyle">@style/Coloquium.Spinner.Ruby</item>

在styles.xml中

<style name="Coloquium.Spinner.Ruby" parent="@style/Holo.Spinner.Light">
    <item name="android:background">@drawable/spinner_holo_white</item>
</style>

问题是微调器样式从未应用(其他样式,如edittextstyle或buttonstyle工作正常),背景永远不会改变,但我尝试这种风格作为spinnerItemStyle并且工作正常,但spinnerItemStyle是内部视图,我想设置外部的样式,即微调器。

如果我直接在布局节点中设置背景,背景变化很好,但我需要为主题中的所有微调器设置spinnerStyle,而不是在布局中。

我测试了很多帖子寻找没有成功的解决方案。

【问题讨论】:

    标签: java android android-holo-everywhere


    【解决方案1】:

    解决办法是:

    HoloEveryWhere 出现使用“spinnerStyle”而不是“android:spinnerStyle”。

    但实际上...我找不到有关此的 HoloEveryWhere 文档。 :S

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2010-10-28
      • 2016-05-26
      • 2013-06-03
      • 2016-06-19
      • 2015-04-21
      • 2018-10-15
      • 2011-04-03
      • 2016-12-03
      相关资源
      最近更新 更多