android 拖动调整表格列宽,Android:减小微调器下拉框的宽度

However, when a spinner is clicked, the drop-down list appears at full width and covers the whole table.

那是因为它实际上是一个弹出式对话框.

There must be a way of restricting the width of the list.

这很难,因为您不是创建对话框的人.考虑到Spinner的编写方式,我甚至没有看到如何通过使用自己的子类扩展Spinner来实现这一目标.您可能必须克隆Spinner源代码,将其移动到另一个包(或类名),并使用How to control the width and height of the default Alert Dialog in Android?中概述的技术更改performClick()以更改AlertDialog的大小.

并且,请记住,Spinner的行为在Honeycomb上有很大的不同,它在冰淇淋三明治上看起来还有待观察.我们没有Honeycomb源代码,因此我的克隆类解决方案将在新设备上给您带来问题.

I have seen a note on R.attr.dropDownWidth which looks as though it may help but I have no idea how to implement this method, let alone if it will actually work.

它不是一种方法,而是一种可以在样式中设置的属性.但是,根据源代码,它似乎仅用于AutoCompleteTextView的下拉列表.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值