在EditText所在的父控件中设置如下属性:

android:focusable="true"
android:focusableInTouchMode="true"

例如:

<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:focusable="true"
android:focusableInTouchMode="true"
> <com.wzh.view.ClearEditText
android:layout_marginTop="5dp"
android:id="@+id/etBqyshwjlw"
style="@style/cetStyle"
android:maxLength="12"
android:hint="本期应税货物及劳务"/> <com.wzh.view.ClearEditText
android:layout_marginTop="5dp"
android:id="@+id/etBqysfw"
style="@style/cetStyle"
android:maxLength="12"
android:hint="本期应税服务"/> <com.wzh.view.ClearEditText
android:layout_marginTop="5dp"
android:id="@+id/etBnyshwjlw"
style="@style/cetStyle"
android:maxLength="12"
android:hint="本年累计应税货物及劳务"/> <com.wzh.view.ClearEditText
android:layout_marginTop="5dp"
android:id="@+id/etBnysfw"
style="@style/cetStyle"
android:maxLength="12"
android:hint="本年累计应税服务"/>
</LinearLayout>

Android 设置让EditText不自动获取焦点的更多相关文章

  1. Android 如何让EditText不自动获取焦点&隐藏软键盘

    感谢大佬:https://blog.csdn.net/a18615971648/article/details/72869345 有时候的项目当中进入某个页面edittext会自动获取焦点弹出软键盘, ...

  2. Android 如何让EditText不自动获取焦点 (转)

    在项目中,一进入一个页面, EditText默认就会自动获取焦点. 那么如何取消这个默认行为呢? 在网上找了好久,有点 监听软键盘事件,有点 调用 clearFouse()方法,但是测试了都没有! x ...

  3. Android 如何让EditText不自动获取焦点

    解决之道:在EditText的父级控件中找一个,设置成 android:focusable="true"     android:focusableInTouchMode=&quo ...

  4. Android:让EditText不自动获取焦点

    解决方法: 在EditText的父级控件中加入属性: android:focusable="true" android:focusableInTouchMode="tru ...

  5. 让EditText不能自动获取焦点

    在activity中放置了1个或1个以上的EditText,进入该activity的时候第一个EditText会接收焦点,我希望里面所有的EditText默认是不接收焦点的,该怎么做呢? 方法: 在第 ...

  6. 如何让EditText不能自动获取焦点(转)

    转载地址:http://blog.csdn.net/subaohao/article/details/9043895 在activity中放置了1个或1个以上的EditText,进入该activity ...

  7. EditText: EditText自动获取焦点并弹出键盘&EditText不自动获取焦点并且不会弹出键盘

    1.EditText不自动获取焦点并且不会弹出键盘 找到EditText的父控件,设置其父控件为: Parent.setFocusable(true); Parent.setFocusableInTo ...

  8. 初始加载时edittext不自动获取焦点的方法

    在做一个搜索功能时,刚进入界面,edittext直接自动获取焦点,这显然不是我想要的. 那么问题来了:如何关闭EditText自动获取焦点的? 尝试了好几个方法,在Java代码添加focus控制,在x ...

  9. 设置Android让EditText不自动获取焦点

    最近在做一个练手项目的时候,因为默认进入的页面有一个EditText控件,每次进入的时候会自动获取焦点弹出软键盘,体验非常不好,后来在网上找到了解决办法:在EditText的父级控件中找到以下属性,设 ...

随机推荐

  1. Linq to OBJECT延时标准查询操作符

    1.Where 操作符用于限定输入集合中的元素,将符合条件的元素组织声称一个序列结果.2.Select  操作符用于根据输入序列中的元素创建相应的输出序列中的元素,输出序列中的元素类型可以与输入序列中 ...

  2. LIBRARY_PATH和LD_LIBRARY_PATH环境变量的区别

    LIBRARY_PATH和LD_LIBRARY_PATH是Linux下的两个环境变量,二者的含义和作用分别如下: LIBRARY_PATH环境变量用于在程序编译期间查找动态链接库时指定查找共享库的路径 ...

  3. Delphi7下实现HTTP的Post操作 转

    Delphi7下实现HTTP的Post操作 unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Gra ...

  4. socketFunction

    socket     socket() 我们使用系统调用socket()来获得文件描述符: #include<sys/types.h> #include<sys/socket.h&g ...

  5. 负重前行的婚纱线上路 - i天下网商-最具深度的电商知识媒体

    负重前行的婚纱线上路 - i天下网商-最具深度的电商知识媒体 负重前行的婚纱线上路

  6. Java高级软件工程师面试考纲

    如果要应聘高级开发工程师职务,仅仅懂得Java的基础知识是远远不够的,还必须懂得常用数据结构.算法.网络.操作系统等知识.因此本文不会讲解具体的技术,笔者综合自己应聘各大公司的经历,整理了一份大公司对 ...

  7. c语言typedef之数组运用

    #include <stdio.h> #include <stdlib.h> typedef ];//int arr[4]取一个别名 arr b c就是int b[4] int ...

  8. swift 随机数

    1.一行代码生成随机数  arc4random() 如果要生成一个生成在一定范围内的随机整数: func randomIn(#min: Int, max: Int) -> Int { retur ...

  9. python标准库之字符编码详解

    codesc官方地址:https://docs.python.org/2/library/codecs.html 相关帮助:http://www.cnblogs.com/huxi/archive/20 ...

  10. iPhone 5,6,6 plus 尺寸