自定义微调的TextView被切断 [英] Custom Spinner TextView is being cut off

查看:259
本文介绍了自定义微调的TextView被切断的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此​​,在所附的截屏与code样品你可以看到我的自定义微调。正如你可以看到我的文字被截断不管什么我尝试做。九片图像设置正确,上面有文字填充了。我有权刚才的一切和我完全茫然...

So in the attached screen shot and the code sample you can see my custom spinner. As you can see my text is getting cut off no matter what I try to do. The nine patch image is set up correctly with the text padding on it too. I have right just about everything and am at a complete loss...

自定义微调

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/spinner"
android:textColor="#555"
android:textSize="22sp"
android:textStyle="bold"
android:typeface="normal"
android:layout_width="wrap_content"
android:layout_height="40sp"
android:gravity="center_vertical|left"
android:singleLine="true" />

实现自定义微调

<Spinner
    android:id="@+id/spinner_both20"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_alignBottom="@+id/b_both20"
    android:layout_alignTop="@+id/b_both20"
    android:layout_marginLeft="4sp"
    android:layout_marginRight="5sp"
    android:layout_toRightOf="@+id/b_both20"
    android:background="@drawable/buttons"
    android:padding="20sp" />

Java的

ArrayAdapter<CharSequence> aBoth = ArrayAdapter
            .createFromResource(getActivity().getApplicationContext(),
            R.array.d20both, R.layout.spinner_settings)

我超级沮丧地花费在这么简单的东西这么多小时。任何帮助将摇滚!

I'm super frustrated to be spending this many hours on something so simple. Any help would rock!

推荐答案

填充将削减切成你内心的文字。

Padding will cut cut into your inner text.

这篇关于自定义微调的TextView被切断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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