如何在Android中设置自动完成TextView的提示 [英] How to set the hint of autocomplete textview in android

查看:167
本文介绍了如何在Android中设置自动完成TextView的提示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在演示项目中添加AutoCompleteTextview,我希望像在EditText中一样设置提示.

Hi I want to add the AutoCompleteTextview in demo project where I am looking to set the hint as like we can do in EditText.

我知道在EditText中使用hint属性是可能的,但是我不知道如何在AutoCompleteTextiview.中完成

I know this is possible in EditText using hint property but I don't know how this can be done in AutoCompleteTextiview.

谢谢.

推荐答案

您可以使用

android:hint="yourHint"

像这样

<AutoCompleteTextView
        android:id="@+id/autoCompleteTextView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:layout_alignRight="@+id/passwordEntry"
        android:ems="10"
        android:text=""
        android:hint="Test" />

这篇关于如何在Android中设置自动完成TextView的提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆