在图像中看到的是具有TextInput
样式的材料OutLined
。您可以在官方文档Filled
中阅读有关此内容和here样式的更多信息。
此外,请不要忘记为此需要材料库。为此,请执行
implementation 'com.google.android.material:material:1.2.0-alpha06'
首先在布局文件中进行搜索视图
<SearchView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_round"/>