android – 如何包装首选项标题?

在这图片中,我的偏好标题并没有包裹其父母.

如何将标题换行到新行?

谢谢.

XML

<CheckBoxPreference
        android:key="keypref"
        android:summary="Summary text does wrap around the borders"
        android:title="The title of this preference is" >
</CheckBoxPreference>

解决方法

您需要进行类似认(android内部)CheckBoxPreference的自定义布局.在标题的xml文本视图中,ellipsize设置为Marque,重复限制无限期,可滚动设置为水平.您可以使用以下命令设置CheckBoxPreference的布局:
<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">

希望这会奏效;)

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...