Question

I have PreferenceScreen contain CheckBoxPreference which referd in manifest to PreferencesTheme , its title text is long so it appear in single line and words cut at end of line , im try to force screen to continue the text in second line by using :

<item name="android:lines">2</item>

in prefs_style.xml but it doesnt work .

any help to solve that will be appreciated , thanks,

Was it helpful?

Solution

I had a similar problem and created a custom layout for my CheckBoxPreference by adding android:layout:

<CheckBoxPreference
   android:defaultValue="true"
   android:key="@string/pref_key"
   android:summary="@string/pref_summary"
   android:title="@string/pref_title"
   android:layout="@layout/preference_layout"/>

With a custom layout you can make the Preference look however you would like. Here is an example of what the internal layout looks like. If you remove the android:singleLine="true" and android:ellipsize="marquee" from that layout you should get the experience you want.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top