2015-01-31 35 views
3

我试图减小Android数字选择器的大小,但已经尝试了几件事情,但我不能。我没有找到一个负责任的属性大小的变化。 想做如下:如何更改数字选择器的大小Android

enter image description here

必须减少,因为我必须把numberpicker有很多的信息在屏幕上。 任何帮助将不胜感激。

回答

0

您可以直接更改XML属性。

<NumberPicker 
     android:id="@+id/numberPicker" 
     android:layout_width="wrap_content" 
     android:layout_height="90dp" 
      android:orientation="vertical" /> 
+0

这不会扩展视图 – SREE 2016-10-21 12:32:05

+0

实际上,在Eclipse的eclipse版本(feb/15)中工作,不能告诉它现在是否在Android Studio中有效。但是,无论如何感谢你花了一些时间来检查这个问题。 – 2016-10-21 15:09:44

+0

现在可能为numberpicker提供了一些新选项,因为我记得上面的一个表现糟糕。 – 2016-10-21 15:11:19

4

我正面临着类似的问题,我想增加NumberPicker的文字大小,但无法找到一个方法来做到这一点作为窗口小部件的一部分。在我的研究中,我发现了以下解决方案:

<NumberPicker 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:scaleX="0.75" 
    android:scaleY="0.75"/> 

将scaleX和scaleY视为放大因子。值< 1将缩小Widget,1将不会更改,> 1会增加其大小。

相关问题