如何更改微调的大小在android系统? [英] How to change size of spinner in android?
本文介绍了如何更改微调的大小在android系统?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以改变弹出窗口的大小,这表明当点击微调,
can we change the size of popup window which shows when click on spinner,
其实它的外观非常广泛,我想减少弹出窗口的宽度,但dn't knw怎么可能
actually its look very wide and i want to reduce the width of pop window, but dn't knw how is it possible
推荐答案
您可以在布局文件更改这些设置。问候微调教程是非常有用的。
You can change these settings in the layout file. The hello-spinner tutorial is very useful.
http://developer.android.com/guide/tutorials/意见/ HELLO-spinner.html
一个新的XML文件添加到您的布局文件夹中。
Add a new XML file to your layout folder.
例如:spinnerLayout.xml
Example: spinnerLayout.xml
<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinnerTarget"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textSize="14pt"
android:textColor="#FF8B1500"
android:gravity="center"/>
更改适配器资源到新的布局文件:
Change the adapter resource to your new layout file:
adapter = ArrayAdapter.createFromResource(
this, R.array.sound, R.layout.spinnerLayout);
这篇关于如何更改微调的大小在android系统?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文