简体   繁体   中英

Custom Spinner TextView is being cut off

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...

Custom spinner

<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" />

Implementing custom spinner

<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!

在此输入图像描述

填充将削减内部文本。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM