码迷,mamicode.com
首页 > 其他好文 > 详细

让NumberPicker中显示文字

时间:2014-08-27 14:45:37      阅读:360      评论:0      收藏:0      [点我收藏+]

标签:android   eclipse   android开发   

最近需要做一个选项框,其中需要选择多个项目,NumberPicker是个不错的选择,如何让它显示文字呢?

其实很简单,如下即可:

		np = (NumberPicker) findViewById(R.id.numberPicker1);
		String[] city = {"北京","上海","广州","深圳","成都","天津"};
		np.setDisplayedValues(city);
		np.setMinValue(0);
		np.setMaxValue(city.length - 1);

显示效果:

bubuko.com,布布扣

让NumberPicker中显示文字

标签:android   eclipse   android开发   

原文地址:http://blog.csdn.net/icyfox_bupt/article/details/38869979

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!