How to wrap preference title?

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

How can I bind the header 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> 
+8
android android-layout android-preferences
source share
2 answers

You will need to create a custom layout similar to the standard (android internal) CheckBoxPreference. In this xml text view, the header should be with an ellipse set to Marque, repeat the constraint indefinitely and scrollable set to horizontal. How can you set the CheckBoxPreference layout 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 this works;)

+1
source share

Just update it. This is a String , so you can use \n to create a new line.

 <CheckBoxPreference android:key="keypref" android:summary="Summary text does wrap around the borders" android:title="The title of this preference\nis this." > </CheckBoxPreference> 
-one
source share

All Articles