Android Honeycomb:如何在 ActionBar 上的微调器中设置右角箭头的样式
这是一个非常具体的问题。我在 onCreate() 方法中添加了 ActionBar 上的微调器。我已经能够将文本样式设置为白色,但无法使下划线和右下角的三角形/箭头显示为白色。这是我的样式:
<item name="android:actionDropDownStyle">@style/customActionBarDropDownStyle</item>
<style name="customActionBarDropDownStyle" parent="android:style/Widget.Holo.Light.Spinner">
<item name="android:textColor">#FFFFFF</item>
</style>
我找不到使下划线和三角形变为白色的样式项/属性。有吗?
这是一个例子。我用红色突出显示了三角形,并在我想将其设为白色的下划线。
This is a pretty specific question. I have a spinner on an ActionBar that is added in the onCreate() method. I have been able to style the text white, but I can't get the underline and the triangle/arrow at the bottom right to appear as white. Here is my styling:
<item name="android:actionDropDownStyle">@style/customActionBarDropDownStyle</item>
<style name="customActionBarDropDownStyle" parent="android:style/Widget.Holo.Light.Spinner">
<item name="android:textColor">#FFFFFF</item>
</style>
I can't find a style item/property that makes the underline and triangle white. Does one exists?
Here's an example. I have highlighted in red the triangle and underline that I want to make white.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
回答有点晚了,但总比没有好:)
您应该创建一个新的 9 patch 可绘制对象并将其设置为 android:actionDropDownStyle 的背景。
这是一个示例:
您无法为几乎每个本机组件设置颜色,因为它们的背景(在大多数情况下)是 9-patch png。
A bit late answer, but better than never :)
You should create a new 9 patch drawable and set it as a background to android:actionDropDownStyle.
here is an example:
You can't set a color to almost every native component, as their backgrounds are (in most cases) 9-patch pngs.
actionDropDownStyle 不能用于更改您在操作栏上添加的微调器的样式;它适用于操作栏模式之一ActionBar.NAVIGATION_MODE_LIST;
至于你的问题,你可以在布局文件中为微调器定义一个选择器,就像这样:
The actionDropDownStyle can not used to change the style of spinner you added on actionbar; its for one of the actionbar mode ActionBar.NAVIGATION_MODE_LIST;
As for your problem, you can define a selector for your spinner in the layout file,just like this:
试试这个:
android:background="@null"
Try this :
android:background="@null"