newToEverything
newToEverything

Reputation: 319

Using ListPreference without the Cancel button

<ListPreference
    android:title="Question?"
    android:summary="%s"
    android:entries="@array/BS"
    android:entryValues="@array/BS"
    android:defaultValue="0"
    android:key="BS"
    ></ListPreference>

I got this ListPreference but it has this cancel button that I don't really want and it is taking up too much space. I can of course set it to white, but I would rather prefer to have it gone.

Upvotes: 1

Views: 733

Answers (1)

newToEverything
newToEverything

Reputation: 319

Found an answer myself:

<ListPreference
    android:title="Question?"
    android:summary="%s"
    android:entries="@array/BS"
    android:entryValues="@array/BS"
    android:defaultValue="0"
    android:key="BS"
    android:negativeButtonText=""
    ></ListPreference>

This actually makes the whole box smaller.

Upvotes: 4

Related Questions