如何包装偏好标题?

Mob*_*ion 8 android android-preferences android-layout

在这张图片中,我的标题Preference并没有包裹它的父母.

如何将标题换行到新行?

谢谢.

在此输入图像描述

XML:

<CheckBoxPreference
        android:key="keypref"
        android:summary="Summary text does wrap around the borders"
        android:title="The title of this preference is" >
</CheckBoxPreference>
Run Code Online (Sandbox Code Playgroud)

小智 -1

只是对此的更新。String您可以使用它\n来创建换行符。

<CheckBoxPreference
        android:key="keypref"
        android:summary="Summary text does wrap around the borders"
        android:title="The title of this preference\nis this." >
</CheckBoxPreference>
Run Code Online (Sandbox Code Playgroud)

  • 这在不同的屏幕分辨率上效果不佳。 (4认同)