CheckBoxPreference标题长文本不会启动第二行

时间:2013-07-27 22:58:14

标签: android preferencescreen

我的PreferenceScreen包含CheckBoxPreference,它在清单中引用了PreferencesTheme,它的标题文本很长,因此它出现在单行中,并且在行尾切换单词,我尝试通过使用强制屏幕继续第二行中的文本: / p>

<item name="android:lines">2</item>
在prefs_style.xml中

但它不起作用。

任何有待解决的帮助都将受到赞赏,谢谢,

1 个答案:

答案 0 :(得分:1)

我遇到了类似的问题,并通过添加CheckBoxPreference为我的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"/>

使用自定义布局,您可以根据需要制作首选项外观。 Here is an example of what the internal layout looks like。如果您从该布局中删除android:singleLine="true"android:ellipsize="marquee",您应该获得所需的体验。

相关问题