Discuz!NT|BBS|论坛

注册

 

发新话题 回复该主题

取消自动获得焦点 [复制链接]

1#
  1. <RelativeLayout
  2. android:layout_width="fill_parent"
  3. android:layout_height="45dp"
  4. android:layout_margin="5dp"
  5. android:focusable="true"
  6. android:focusableInTouchMode="true"
  7. android:background="#fff">

  8. <SearchView
  9. android:id="@+id/sv_khwh"
  10. android:layout_width="match_parent"
  11. android:layout_height="wrap_content"
  12. android:iconifiedByDefault="false"
  13. android:windowSoftInputMode = "stateHidden"
  14. android:queryHint="请输入关键字" />
  15. </RelativeLayout>
复制代码
  1. 在需要去掉的父容器添加
  2. android:focusable="true"
  3. android:focusableInTouchMode="true"
复制代码
分享 转发
TOP
发新话题 回复该主题