我想给 EditText 一个放大镜效果。它在 iPhone 中的搜索 View 中给出。
可以在安卓中做吗?我怎样才能做到这一点?
请帮我
最佳答案
使用 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"/>