在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. EE就业最好的方向是转CS,其次是VLSI/ASIC DESIGN & VERIFICATION

    Warald在2012年写过一篇文章<EE现在最好就业的方向是VLSI/ASIC DESIGN VERIFICATION>,三年过去了,很多学电子工程的同学想知道现在形势如何. 首先,按照 ...

  2. Linq to object 技巧、用法集锦

    一.一个字符串,一个字符串数组.判断字符串数组里的元素出现在字符串中的有几个. class Program { static void Main(string[] args) { string str ...

  3. 奇葩的SQL*Net more data from client等待,导致批处理巨慢

    <pre name="code" class="sql"><pre name="code" class="sql ...

  4. bzoj1786

    题目:http://www.lydsy.com/JudgeOnline/problem.php?id=1786 刚看上去觉得挺吓人的...... 冥冥之中我的内心深处告诉我填进去的数一定是非严格递增的 ...

  5. bzoj2154

    #include<cstdio> #include<cstdlib> #include<iostream> #include<fstream> #inc ...

  6. jquery 实现全选反选

    jquery代码 $(function () { $('#inputCheck').click(function () { if ($(this).attr("checked")) ...

  7. xcode忽略警告

    1.对整个文件使用 你的工程 -> 你的target -> Build Phases -> Compile Sources -> 搜索要忽略警告的文件名,在 Compiler ...

  8. Bugscan学习笔记------关于urlparse

    urlparse模块主要是把url拆分为6部分,并返回元组.并且可以把拆分后的部分再组成一个url.主要有函数有urljoin.urlsplit.urlunsplit.urlparse等. ***** ...

  9. DirectX Sample-Blobs实现原理

    这个例子的实现主要包括两步: 1.计算三维采样坐标和color,实现代码是for( i = 0; i < NUM_Blobs; ++i )那个循环,计算完成以后g_pTexGBuffer[0]保 ...

  10. [RxJS] Reactive Programming - Clear data while loading with RxJS startWith()

    In currently implemention, there is one problem, when the page load and click refresh button, the us ...