Mou*_*esh 2 android android-layout android-edittext
"编辑"文本中的MaxLines属性不起作用:
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_marginBottom="5dp"
android:paddingLeft="10dp"
android:paddingRight="10dp"
android:textColorHint="@color/colorAccent"
android:layout_height="wrap_content">
<EditText
android:id="@+id/register_userName"
android:maxLines="1"
android:textColorHint="@color/colorAccent"
android:textColor="@color/colorAccent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Name" />
</android.support.design.widget.TextInputLayout>
Run Code Online (Sandbox Code Playgroud)
我在我的gradle中使用以下内容:
compileSdkVersion 25
buildToolsVersion '25.0.2'
Run Code Online (Sandbox Code Playgroud)
虽然我已经android:maxLines="1"为我的编辑文本指定了编辑文本转换到我在Android 5.1上测试的新行,但这在我以前的应用程序上工作正常,但我最近更新了我的构建工具,我不知道为什么android:maxLines="1"没有按预期工作.
bee*_*eeb 12
现在你应该使用inputType="text"with maxLines="1"一行.
讨论SO为何弃用: 在Android中是否弃用了xml属性singleLine?
Google问题:https: //code.google.com/p/android/issues/detail?id = 221762
| 归档时间: |
|
| 查看次数: |
5571 次 |
| 最近记录: |