我正在使用 Android SharedPreferences API 来构建设置屏幕。
我有一个设置,我需要一个长文本来向用户解释它的含义(我想要主标题和较小的副标题,但我认为它需要大量定制)settings.xml 就像:
<EditTextPreference
android:defaultValue="15"
android:inputType="number"
android:icon="@drawable/ic_timer"
android:key="@string/pref_comment_interval"
android:persistent="true"
android:lines="2"
android:title="@string/time_between_comments" />
但即使在文本处设置lines=2
和换行也会被换行。\n
time_between_comments
<string name="time_between_comments">Time between comments (in seconds)\nLower is faster</string>
我怎样才能使文本换行?