如何更改微调的大小在android系统?如何更改、大小、系统、android

2023-09-07 12:41:48 作者:聚翊堂神话

我们可以改变弹出窗口的大小,这表明当点击微调,

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);