如何包装preference称号? [英] How to wrap preference title?

查看:198
本文介绍了如何包装preference称号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这幅画,标题我 preference 不环绕它的父。

我怎样才能使标题换到一个新行?

感谢。

XML:

 <复选框preference
        机器人:键=键preF
        机器人:总结=摘要文本并围绕边框包裹
        机器人:标题=这个preference的标题是>
< /复选框preference>
 

解决方案

您需要做它类似于默认的(机器人内部)复选框preference自定义布局。在标题中的XML文本视图应该与ellipsize设置为马凯,重复限制无限期和滚动设置为横向。比你可以设置的复选框preference与布局:

 <复选框preference
    机器人:关键=key_checkbox_ preF
    机器人:总结=摘要文本并围绕边框包裹
    机器人:标题=这个preference标题
    机器人:布局=@布局/ custom_checkbox_ preferences_layout>
 

希望将工作;)

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

How can I make the title wrap to a new line?

Thanks.

xml:

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

解决方案

You would need to make custom layout which resembles default (android internal) CheckBoxPreference. In that xml text view of title should be with ellipsize set to Marque, repeat limit indefinite and scrollable set to horizontal. Than you can set layout of CheckBoxPreference 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 that would work ;)

这篇关于如何包装preference称号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆