如何更改/减小Android的微调大小? [英] How can I change/decrease the Android spinner size?

查看:106
本文介绍了如何更改/减小Android的微调大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想,以减少/更改微调大小,其中包括:

  1. 微调对象尺寸
  2. 显示的字体(其大小和颜色)
  3. 当我打开微调器所显示的列表视图(其字体大小和颜色)
解决方案

您可以在布局文件更改这些设置。 你好微调教程是非常有用的。

<一个href="http://developer.android.com/guide/tutorials/views/hello-spinner.html">http://developer.android.com/guide/tutorials/views/hello-spinner.html

添加一个新的XML文件到你的布局文件夹。

例:spinnerLayout.xml

 &LT; XML版本=1.0编码=UTF-8&GT?;
    &LT; TextView中的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
              机器人:ID =@ + ID / spinnerTarget
              机器人:layout_width =FILL_PARENT
              机器人:layout_height =WRAP_CONTENT
              机器人:TEXTSIZE =14pt
              机器人:文字颜色=#FF8B1500
              机器人:重力=中心/&GT;
 

更改适配器资源到新的布局文件:

 适配器= ArrayAdapter.createFromResource(
                对此,R.array.sound,R.layout.spinnerLayout);
 

I'd like to decrease/change the spinner size which includes:

  1. the spinner object size
  2. the font displayed (its size and color)
  3. When I open spinner the list view which is displayed (its font size and color)

解决方案

You can change these settings in the layout file. The hello-spinner tutorial is very useful.

http://developer.android.com/guide/tutorials/views/hello-spinner.html

Add a new XML file to your layout folder.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆