我认为singleLine="true"
相当于maxLines="1"
,但我发现Android Studio中的以下预填充字段同时包含这两个字段。有区别吗?是否有一个已知的错误导致两者都需要?android singleLine vs maxLines
<EditTextPreference
android:key="example_text"
android:title="@string/pref_title_display_name"
android:defaultValue="@string/pref_default_display_name"
android:selectAllOnFocus="true"
android:inputType="textCapWords"
android:capitalize="words"
android:singleLine="true"
android:maxLines="1" />
这是来自pref_general.xml
文件。
也许有关? http://stackoverflow.com/a/17125324/2095855 –
谢谢。这部分回答了这个问题。但是它并没有说明他们为什么在我提供的例子中都展现出来。 –
这与它能够用键盘添加新行有什么关系吗?我非常确定singleLine =“true”会阻止它制作另一行。 –