更改微调的背景颜色,但保持箭头 [英] Change spinner background color but keep arrow

查看:921
本文介绍了更改微调的背景颜色,但保持箭头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经看了几件事这件事,但是我无法找到我所需要的。 我想保持的灰色箭头,但我想删除的默认样式单杠,并有一个白色的背景。你有我怎么能做到这一点任何想法?

I've read several thing about it but I can't find what I need. I want to keep the grey arrow but I want to remove the horizontal bar from the default style and have a white background. Do you have any idea of how I can do this ?

下面是我现在有(默认微调样式):

Here is what I have now (default spinner style) :

下面是我想要的:

推荐答案

有关的记录,我发现了一个简单的解决方案:总结你的微调中相对布局,并添加图片:

For the record, I found an easy solution : Wrap your spinner in a relative layout and add an image :

 <RelativeLayout 
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:background="@drawable/borderbottom_white"<!-- white background with bottom border -->
     android:layout_marginTop="15dp"  >
        <Spinner
        android:id="@+id/postfield_category"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:textSize="16sp"
        android:background="@null"
        android:minHeight="0dp" />
        <ImageView 
         android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignParentRight="true"
        android:src="@drawable/arrowspinner" />
    </RelativeLayout>

这篇关于更改微调的背景颜色,但保持箭头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆