微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Android微调文本大小

由于一些设计问题,我设计的旋转器具有较小的宽度和高度.而这个较小的宽度和高度没有显示在微调器的提示中写入的完整文本.
如果有任何解决方案可以减少微调器的文本大小,请帮助.

我附上问题的屏幕截图.

http://www.freeimagehosting.net/97147

解决方法:

根据您的需要使用以下代码……

ArrayAdapter adapter = ArrayAdapter.createFromresource(this, R.array.Questions, R.layout.custom_spinner_list);
            adapter.setDropDownViewResource(R.layout.customer_spinner);
            spin.setAdapter(adapter);

custom_spinner_list.xml

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:text="@+id/TextView01"
    android:id="@+id/TextView01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="12dp"
    android:textColor="#000000">
</TextView>

customer_spinner.xml

<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:text="@+id/TextView01"
    android:id="@+id/TextView01"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:textSize="12dp"
    android:textColor="#000000"
    android:height="42dp"
    android:gravity="center_vertical"
    android:padding = "2dp">
</TextView>

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐