Spinner Android中的半截文字

时间:2012-01-14 20:57:11

标签: android layout text resize spinner

我在Android上有一个布局,但是如果我更改微调器的大小我的文本被剪切,我尝试自定义背景到微调器并尝试布局默认但不解决。

我的XML:     

            <Spinner
                android:id="@+id/spinner2"
                android:layout_width="wrap_content"
                android:layout_height="40px"
                android:layout_marginRight="2dip"
                android:layout_weight="1"
                android:background="@drawable/spinner_custom"
                android:gravity="left|center_vertical"
                android:paddingLeft="4dip"
                android:textSize="16px" />

            <Spinner
                android:id="@+id/spinner2"
                android:layout_width="wrap_content"
                android:layout_height="40px"
                android:layout_marginRight="2dip"
                android:layout_weight="1"
                android:background="@drawable/spinner_custom"
                android:gravity="left|center_vertical"
                android:paddingLeft="4dip"
                android:textSize="16px" />
        </TableRow>

我怎么能解决它?

具有自定义背景的屏幕:

http://img814.imageshack.us/img814/8284/spinner.jpg

enter image description here

1 个答案:

答案 0 :(得分:3)

Spinner的自定义背景是图像还是xml文件?如果它是一个xml可绘制文件,请检查您是否在底部没有使用填充。

还尝试将layout_height值更改为wrap_content而不是设置为40px,这可能会导致问题。