android EditText提示不出现

这似乎是我遇到的最奇怪的事情.

这是一个布局:

<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_horizo​​ntal”或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>

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...