微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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">

希望这会奏效;)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐