我想给 EditText 一个放大镜效果。就像它在 iPhone 中的搜索 View 中一样。 有可能在 Android 中做吗?我怎样才能做到这一点? 请帮助我
最佳答案
使用 EditText 你有这个选项:
Una opción usando el EditText
es definiendo el icono, y usando la propiedad android:hint
para el texto:
用 android:drawableLeft
定义图标,用 android:hint
定义提示
但正确的方法是使用 SearchView小部件:
<SearchView
android:id="@+id/searchProduct"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
关于android - 如何在 Android 的 EditText 中提供放大镜效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6289491/