2017-04-19 28 views
-4
<AutoCompleteTextView 
      android:id="@+id/edtname"> 

我试图android:hintandroid:CompletionHint,但无法显示在AutocompleteTextView提示文本。问题:提示=“”功能

在此先感谢!

回答

0

设置该XML的:

<AutoCompleteTextView 
     android:id="@+id/autoc" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_conten" 
     android:ems="10" 
     android:text="" 
     android:hint="HintYouWantToGive" /> 
+0

谢谢。我早些时候尝试过,它显示了设计中的暗示,但它在运行时不起作用,可能是一些数据处理活动而忽略了它的价值。是否有任何步骤来实际验证提示(除了只在触摸文本视图后设置提示的sethint之外)。 –

+0

排序。谢谢 。问题与提示和背景的颜色:) –

0

使用属性:android:hint显示hint文本。对于hint textbackground,您应该使用不同的color

<AutoCompleteTextView 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:hint="This is a hint" 
    android:textColorHint="#000000" 
    android:background="#FFFFFF" >   
</AutoCompleteTextView> 
+0

谢谢你。我早些时候尝试过,它显示了设计中的暗示,但它在运行时不起作用,可能是一些数据处理活动而忽略了它的价值。是否有任何步骤来实际验证提示(除了只在触摸文本视图后设置提示的sethint之外)。 –

+0

排序。谢谢 。问题是与提示和背景的颜色:) –

+0

哦,我明白了,这是一个常见的错误。您应该为提示文字和背景使用不同的颜色。顺便说一句,高兴地知道它的工作... – FAT

0
<AutoCompleteTextView 
     android:id="@+id/autoCompleteTextView1" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:hint="**Your Hint**" /> 
+0

谢谢。我早些时候尝试过,它显示了设计中的暗示,但它在运行时不起作用,可能是一些数据处理活动而忽略了它的价值。是否有任何步骤来实际验证提示(除了只在触摸文本视图后设置提示的sethint之外)。 –

+0

排序。谢谢 。问题与暗示和背景的颜色:) –

+0

好的...欢迎... –