Hint in Android

匆匆过客 提交于 2019-12-07 12:10:34

问题


I tried to show a hint in the EditText of my form, but i can't see that hint that i have set in the XML Layout while my application gets deployed, but i can able see the hint in eclipse designer view, but while getting deployed the same hint suppose to appear is missing, i tried with all the possible ways still i could not get the hint in the EditText... This is one of the Edit Text layout that i have used..

<EditText android:id="@+id/SetTimerSec_EditText01"
    android:layout_width="60sp" 
    android:layout_height="40sp"
    android:singleLine="true" 
    android:layout_x="220sp" 
    android:layout_y="170sp"
    android:hint="0"
    android:inputType="phone"
    android:textColorHint="@color/black"
    android:gravity="center"
    android:focusableInTouchMode="true" />

[link text][1]

Can anybody Help me..Please

Thanks in advance

[1]: http://imgur.com/PzomF.jpg [ScreenShot of Designer View with hint displayed][1]


回答1:


It seems like a SDK bug, or at least related to one.
http://code.google.com/p/android/issues/detail?id=7252

The hint shows up if you remove the following:
android:gravity="center"




回答2:


add android:ellipsize="start" and your hint will show up and be centered!



来源:https://stackoverflow.com/questions/3642234/hint-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!