Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to wrap preference title?

In this picture, the title of my Preference does not wrap around its parent.

How can I make the title wrap to a new line?

Thanks.

enter image description here

xml:

<CheckBoxPreference
        android:key="keypref"
        android:summary="Summary text does wrap around the borders"
        android:title="The title of this preference is" >
</CheckBoxPreference>
like image 718
MobileCushion Avatar asked Apr 27 '12 11:04

MobileCushion


1 Answers

You would need to make custom layout which resembles default (android internal) CheckBoxPreference. In that xml text view of title should be with ellipsize set to Marque, repeat limit indefinite and scrollable set to horizontal. Than you can set layout of CheckBoxPreference with:

<CheckBoxPreference
    android:key="key_checkbox_pref"
    android:summary="Summary text does wrap around the borders"
    android:title="The title of this preference."
    android:layout="@layout/custom_checkbox_preferences_layout">

Hope that would work ;)

like image 72
Ewoks Avatar answered Oct 22 '22 22:10

Ewoks