java Spinner字体大小-----链接:http://stackoverflow.com/questions/10409871/how-to-increase-spinner-item-fon

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java Spinner字体大小-----链接:http://stackoverflow.com/questions/10409871/how-to-increase-spinner-item-fon相关的知识,希望对你有一定的参考价值。

// Save the below xml as spinner_layout.xml in layout folder

<?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:textColor="#000000"
          android:textSize="13sp"
/>

//change the textSize which you want. and use the below adapter code to fill it.
Spinner food = (Spinner) findViewById(R.id.spinner1);
ArrayAdapter<CharSequence> foodadapter = ArrayAdapter.createFromResource(
            this, R.array.item_array, R.layout.spinner_layout);
foodadapter.setDropDownViewResource(R.layout.spinner_layout);
food.setAdapter(foodadapter);

以上是关于java Spinner字体大小-----链接:http://stackoverflow.com/questions/10409871/how-to-increase-spinner-item-fon的主要内容,如果未能解决你的问题,请参考以下文章