这似乎是我遇到的最奇怪的事情.
这是一个布局:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <EditText android:id="@+id/GuessAppEditText" android:lines="1" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:gravity="center_horizontal" android:inputType="textCapWords" android:hint="@string/Hint" /> </RelativeLayout>
EditText的提示未显示.
如果我删除android:gravity =“center_horizontal”或android:inputType =“textCapWords”,提示变得可见.
我绝对不知道重力和textCapWords与提示有什么关系.这是另一个Android bug还是我做错了?在前一种情况下,什么是解决办法?我想让我的文本中心对齐和大写,并提示显示.或者我想要太糟糕的Android?
解决方法
只需添加一行,它将工作,即android:ellipsize =“开始”
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" > <EditText android:id="@+id/GuessAppEditText" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:ellipsize="start" android:gravity="center_horizontal" android:hint="hint" android:inputType="textCapWords" android:lines="1" /> </RelativeLayout>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。