开发者

Android spinner text size

Due to some designing issues i am designing my spinner with smaller width and height. And this smaller width and height not showing complete text written in the prompt of spinner. Please help if any solution possible to decrease the text size of the spinner.

I am attaching the screen shot of the problem.

htt开发者_如何学编程p://www.freeimagehosting.net/97147


Use the below code as per your need...

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>


Try using android:paddingTop = "2dp" or android:paddingTop = "1dp" etc, which ever is suitable.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜