避免Activity启动时某个控件马上获取焦点(如EditText/Gallery等)

来源:互联网 发布:淘宝卖家新手入门教程 编辑:程序博客网 时间:2024/06/06 03:50

一:一般招数:AndroidManifest.xml中的<Activity>节点中配置android:windowSoftInputMode="adjustUnspecified|stateHidden"(一般无用,经测试)

二:绝招:在布局中间的开头加入(有用)

[html] view plaincopy
  1. <LinearLayout  
  2.        android:focusable="true"  
  3. android:focusableInTouchMode="true"  
  4.        android:layout_width="0px"  
  5. android:layout_height="0px"/>  
0 0
原创粉丝点击