【Android】Android中如何取消调转界面后EditText默认获取聚焦问题
2024-10-13 15:50:26
参考资料:
https://www.cnblogs.com/dream-cichan/p/aaaa.html
http://blog.csdn.net/u013703461/article/details/50388395
解决方案:
在EditText的父控件中加上这两行代码即可:
android:focusable="true"
android:focusableInTouchMode="true"
如:
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="54dp"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:focusable="true"
android:focusableInTouchMode="true"
android:orientation="horizontal" > <Spinner
android:id="@+id/spinnerWorkYear"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0"
android:visibility="invisible" /> <Spinner
android:id="@+id/spinnerLayerList"
android:layout_width="145dp"
android:layout_height="54dp" /> <EditText
android:id="@+id/txtMapQueryKeyword"
android:layout_width="185dp"
android:layout_height="wrap_content"
android:layout_marginTop="1dp"
android:text="0200001530122" /> <Button
android:id="@+id/btnSearch"
android:layout_width="120dp"
android:layout_height="54dp"
android:drawableLeft="@drawable/gis_search"
android:text="搜索" />
</LinearLayout>
最新文章
- 【Tomcat】配置Tomcat
- 【转】ORACLE定期清理INACTIVE会话
- C#模拟键盘输入(一)
- EXT Grid celleditor列编辑,动态控制某一单元格只读
- 用C语言把双向链表中的两个结点交换位置,考虑各种边界问题。
- 使用expdp时遇到ORA-39002、ORA-39070错误
- JQuery Object vs. DOM element
- BZOJ3838 : [Pa2013]Raper
- 跨平台音乐播放器qmmp(Cross-Platform Audio Player Qmmp)
- Spark Streaming揭秘 Day23 启动关闭源码图解
- 【JSTL EL】 jsp 页面学习
- 基于visual Studio2013解决算法导论之009快速排序随机版本
- Redis数据结构
- shell 中的特殊变量
- hadoop学习视频
- 使用Ratpack与Spring Boot构建高性能JVM微服务
- ABP之调试
- MySQL和Mongodb的区别与应用场景对比
- day15_python_1124
- 为什么建议php字符串使用单引号而不是双引号