【问题标题】:How to set Maximum size of the spinner如何设置微调器的最大尺寸
【发布时间】:2014-04-24 20:13:00
【问题描述】:

我的问题是如何设置 微调器的最大尺寸。我检查了解决方案,但它们使用的是 xml 文件。但我想通过 java-code。有人可以帮忙吗??

【问题讨论】:

标签: android android-spinner


【解决方案1】:

记不清了,但您可以使用以下方法之一:public void setDropDownWidth (int pixels),public void setMinimumHeight (int minHeight),public void setMinimumHeight (int minHeight)。将它们与您的微调器一起使用,例如:sp.setDropDownWidth(your pixel value)。

您还可以实现自己的微调器,例如 this。

您也可以复制 Spinner 类并对其进行修改。Spinner Class 在这里。

【讨论】:

    【解决方案2】:

    API 级别 16 之后就可以使用了,

    spinner.setDropDownWidth(desiredWidth);
    

    【讨论】:

      猜你喜欢
      • 2011-01-24
      • 2013-04-30
      • 1970-01-01
      • 1970-01-01
      • 2011-10-14
      • 2017-03-27
      • 1970-01-01
      • 2022-01-18
      • 1970-01-01
      相关资源
      最近更新 更多