下拉式微调器对齐 [英] DropDown Spinner Alignment

查看:71
本文介绍了下拉式微调器对齐的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个Adroid应用程序. 所以我想以编程方式自定义DropDown Spinner的行为. 我覆盖了getDropDownView方法,但找不到任何东西可以更改DropDown的尺寸及其对齐方式. 我只这样改变DropDown中每一行的颜色

I develop an Adroid application. So i want to customize programmatically the behavior of DropDown Spinner. I overwrite the getDropDownView method but i cannot find anything to change the dimension of DropDown and also the alignment of it. I only change the color of each line in DropDown like this

            View view = this.getView(position, convertView, parent);
        if (position % 2 == 0) {
            view.setBackgroundColor(Color.YELLOW);
        } else {
            view.setBackgroundColor(Color.GRAY);
        }

有人可以帮助我吗? 谢谢

Can someone help me? Thanks

推荐答案

我等待某人的帮助.没发生所以我找到了一种解决方法.我使用TextView,然后单击ListView.因此,如果有人找到更好的方法,请告诉我

I wait for someone to help me. Not happened. So i found a workaround. I use a TextView and on click a ListView is displayed. So if someone find a better approach, please let me know

这篇关于下拉式微调器对齐的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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