- 在隐藏系统软键盘时,光标也消失了的处理方法
mapleSeriesX
最开始直接就是用的setInputType(InputType.TYPE_NULL)方法但是发现系统键盘是隐藏了但是光标也不在了,通过查询发现在4.0以后需要使用另外一个方法才能显示光标但是这个方法并没有暴露给我们,需要用到反射机制。//隐藏系统键盘publicvoidhideSoftInputMethod(EditTexted){getWindow().setSoftInputMode(Wind
- Android-完美解决EditText和ScrollView的滚动冲突 转载
xiaoerbuyu1233
android
https://blog.51cto.com/u_15073486/3650167publicclassMainActivityextendsActivityimplementsView.OnTouchListener{privateEditTextmEditText;@OverrideprotectedvoidonCreate(BundlesavedInstanceState){super.on
- Android EditText关于imeOptions的设置和响应
左大星
Android进阶androidandroidjetpackandroid-jetpack
日常开发中,最绕不开的一个控件就是EditText,随之避免不了的则是对其软键盘事件的监听,随着需求的不同对用户输入的软键盘要求也不同,有的场景需要用户输入完毕后,有一个确认按钮,有的场景需要的是回车,有的场景需要用户输入后进入下一项或者搜索,所幸的是,大部分需求场景通过修改原生设置就可满足,只要极少情况下才需要去写自定义键盘。而关于EditText唤起的软键盘中回车的功能可以通过imeOptio
- 判断输入的是否是英文,数字,汉字
Summer_27d1
···publicvoidonClick(Viewview){switch(view.getId()){caseR.id.bt_1://搜索Viewinflate=View.inflate(this,R.layout.sousuo_layout,null);finalEditTextmViewById=inflate.findViewById(R.id.sousuo1);newAlertDialo
- EditText(输入框)详解
微语博客
简介EditText是Android的输入控件,负责与用户交互数据。EditText与TextView基本类似,TextView的属性也大都适用于EditText,这里讲解一些EditText的常见属性。如果想了解TextView的使用,可以阅读我的上一篇文章,TextView详解,另外这里贴一下EditText的官方文档EditText官方文档基础属性id:设置控件的id用于java代码中找到该
- EditText
船长_e30d
EditText默认会自动获取焦点,有的时候已进入界面,就会弹出软键盘,所以我们可以给EditText套个父层集,然后让父层去获取焦点.这样就避免了editText自动获取焦点的问题
- 【Android】TextView详解和常用属性
Full guts
Androidandroidxmlandroidstudiojava
目录一、TextView简介二、常用属性一、TextView简介在Android开发中,TextView是比较常用的控件,展示文本信息,其属性也是比较繁多的,可设置文字的字体大小、颜色、背景色、边距等基本样式。TextView的继承关系:TextView作为一个大类,其继承了View,更是Button、EditText等多个关键控件类的父类。Button:用户可以点击或单击以执行操作的用户界面元素
- 【Android入门到项目实战--3.1】—— 七种常用控件的使用(TextView、Button、EditText、ImageView、ProgressBar、AlertDialog等)
四月天行健
Androidandroidandroidstudioidejava
目录一、常用的控件1、TextView2、Button3、EditText4、ImageView5、ProgressBar1)如何让加载条在加载完成时消失?2)如何修改进度条样式?6、AlertDialog7、ProgressDialog本篇主要讲解Android的常用控件。一、常用的控件1、TextViewTextView控件用于在界面上显示一段文本信息。下面尝试实现。XML布局文件代码如下:a
- Android EditText 数字键盘 输入负数 小数点的 操作
buhanzhe
代码如下:mContentInputView.setInputType(InputType.TYPE_CLASS_NUMBER|InputType.TYPE_NUMBER_FLAG_DECIMAL|InputType.TYPE_NUMBER_FLAG_SIGNED);TYPE_CLASS_NUMBER标准数字TYPE_NUMBER_FLAG_DECIMAL带小数点TYPE_NUMBER_FLAG_
- 写一个APP实现nrf master功能(展示一下功能)
昨天剩下的一杯冷茶
扫描Activity,当点击某个蓝牙设备时,会调到第二个界面image.png跳转到第二个Activity,点击CONNECT按键image.png可以看到手环显示蓝牙图标image.png在EditText输入震动命令1700020202(手环的协议),看到手环震动,且手环应答命令为0x9617image.png
- Android EditText动态改变颜色
songsyl1207
直接上代码importandroid.content.Contextimportandroid.content.res.ColorStateListimportandroid.graphics.drawable.Drawableimportandroid.os.Buildimportandroid.util.AttributeSetimportandroid.widget.EditTextimpo
- 学习Android的第七天
世俗ˊ
Android学习android
目录AndroidEditText输入框设置默认提示文本范例获得焦点后全选组件内所有文本内容范例限制EditText输入类型android:inputType值列表范例设置最小行,最多行,单行,多行,自动换行范例设置文字间隔范例设置英文字母大写类型范例控制EditText四周的间隔距离与内部文字与边框间的距离范例EditText光标位置的控制设置EditText获得焦点同时弹出小键盘范例带表情的E
- 今日成果
小菊花麻麻颗糖
本来想如果不填字的话,实用AlertDialog弹出一个提示框,然后填字的话就弹出这个搜索框,但是没有实现很遗憾。图片发自App简单的布局EditText和Button在水平方向上平分宽度图片发自App更换app图标图片发自App
- 安卓——计算器应用(Java)
九考
AI生成代码androidjava
步骤1:设置AndroidStudio项目创建一个新的Android项目,选择Java作为编程语言。步骤2:设计用户界面打开activity_main.xml文件,在res/layout目录下,设计你的计算器用户界面。这个例子使用了LinearLayout来排列两个EditText输入框和几个按钮。步骤3:实现计算逻辑在MainActivity.java文件中,添加逻辑来处理用户的输入和计算请求。
- 短信验证码控件简单实现
不落孤城
第一次在上码文章,主要是记录下以后可能会用到的代码,自用顺便提供给可能需要的同学。一、需求背景产品经理突然要求更改短信验证码的样式,觉得验证码输入太过于简单,已经落后市场上其他竞品了,效果图如下:6位验证码输入满6位,自动调用接口去验证输入是否正确。验证错误后,验证码变红并提醒用户。允许用户进行删除。二、简单思路及实现方案本来是准备使用6个Edittext进行操作,后来研究发现焦点的传递和删除时,
- Android View篇之自定义验证码输入框
Android高级工程师
首先,我们来看看实现的是怎么样的效果:image.png如果我们拿到这样的UI,想到的布局应该是用4个EditText包在横向的LinearLayout里面,但今天要讲的View,所以我们决定用一个自定义的EditText画出来。学到什么?基本理解画布概念画布的状态、平移布局测量画图片功能需求高亮当前输入框输入满4个数字自动调用方法思路完全重画一个EditText,就包含了测量布局和重新绘制这两个
- 如何将dialog中的button动态设置为disable
超__越
构造一个自定义的dialog,其中包括一个编辑栏(EditText)和两个按钮(确定和取消)如果想要当EditText为空的时候让确定按钮为不可点击状态privatevoidcreateCustomDialog(ContextdialogContext,finalintposition,StringdefaultNumber){finalEditTexteditText=newEditText(d
- Android edittext限制输入金额
xiaoerbuyu1233
android
Android实现EditText输入金额-腾讯云开发者社区-腾讯云publicstaticvoidsetMoney(EditTexteditText){if(editText==null)return;//设置只能输入金额的InputFiltereditText.setFilters(newInputFilter[]{newInputFilter(){finalPatternmPattern=P
- android edittext格式验证,Android:如何验证EditText输入?
980971
androidedittext格式验证
Android:如何验证EditText输入?我需要在一系列EditTexts上进行表单输入验证。我使用OnFocusChangeListeners在用户输入每个之后触发验证,但这不符合上一个EditText的需要。如果在键入最终的EditText时单击“完成”按钮,则InputMethod将断开连接,但技术上焦点永远不会丢失在EditText上(因此永远不会发生验证)。什么是最好的解决方案?当I
- android+禁止输入表情,Android禁止输入表情符号的EditText
weixin_39520204
android+禁止输入表情
最近刚做完项目,出了个测试包就开开心心的把项目发给老板测试了老板刚装上就给我批评了一顿,说刚用上就发现一个重大bug,还想不想要工资了我当时心里就想:“sb,不会用吧”。。。。。言归正传,现在很多输入法都自带了表情,输入的时候很方便,但是对我们程序员来说就不那么方便了,因为直接输入表情后台不做处理的话会报错的。虽然跟我们前端没有半毛钱关系,但是这毕竟也是一个bug,该处理处理下。在网上看了些资料发
- Android简单支持项目符号的EditText
IT江湖小熊
androidandroidBulletEditText项目符号BulletEditText文本编辑器
一、背景及样式效果因项目需要,需要文本编辑时,支持项目符号(无序列表)尝试了BulletSpan,但不是很理想,并且考虑到影响老版本回显等因素,最终决定自定义一个BulletEditText。先看效果:视频效果二、自定义ViewBulletEditText自定义控件BulletEditText源码:packagecom.ml512.widgetimportandroid.content.Conte
- Anroid EditText禁止输入空格、特殊符号
hao_developer
有时候我们需要限制EditText输入的字符类型,如空格,特殊字符等,这时候我们可以使用系统提供的输入过滤器——InputFilter。具体实现如下:/***禁止输入空格*@parametText*/funsetEditTextInhibitInputSpeChat(etText:EditText){valfilter=InputFilter{source,start,end,dest,dstar
- EditText不弹输入法
我叫杨毅
让EditText之前的控件先获得焦点,即在EditText前面的一个控件上设置属性:android:focusable="true"android:focusableInTouchMode="true"注意:一定要是之前的一个控件,之后的会没有效果
- Edittext输入框教程---Android APP安卓开发小白教程4
船长科技
01简介这篇文章主要是学习EditText输入框的设置android:hint输入提升android:textColorHint输入提示的文字的颜色android:drawableXxxx在输入框的指定方位添加图片android:drawablePadding设置图片与输入内容的间距android:paddingXxxx设置内容和边框的间距android:background背景色02操作这是在输
- 弹出数字键盘的方法
爱你忘了熟悉
如果你的EditText的输入类型为数字,那么会弹出数字键盘android:inputType="number"下面进入重要的地方EditTextinputText=(EditText)findViewById(R.id.phone_num);inputText.setFocusable(true);inputText.setFocusableInTouchMode(true);inputText
- 第二章:Android UI组件介绍
JackHCC
基本UI组件TextView(文本框)1.常用属性:text,textSize(单位sp),textColors,singleLine;EditText(输入框)1.常用属性:hint,inputType,drawableLeft(插入图片),drawablePadding;2.常用方法:getText();Button(按钮)与ImageButton(图像按钮)1.常用属性:text,onCli
- Android打开关闭软键盘
奔跑吧李博
Edittext在项目十分常见,当用到搜索功能时,进入搜索页面需要自动弹出软键盘,点击搜索,就要将软键盘关闭,这里就是我的软键盘工具类,实现的2个功能:1.软键盘的打开与关闭2.判断当前软键盘是否打开importandroid.app.Activity;importandroid.content.Context;importandroid.view.inputmethod.InputMethodM
- Android:AlertDialog自定义对话框
leekey_sjtu
Androidandroidkotlinandroidstudio
Dialog//加载自定义的viewvalview=LayoutInflater.from(this).inflate(R.layout.your_layout,null)valeditText=view.findViewById(R.id.et_dialog)//创建对话框AlertDialog.Builder(this).apply{setTitle("新建列表")//设置标题setView(
- [转]EditText实现多行输入和软键盘发送按钮共存
Amy_LuLu__
原文:虚拟软键盘回车键修改为“发送”,edittext不多行显示的bug,解决方案如下(安卓开发实战总结)https://blog.csdn.net/lixueqiang001/article/details/90515198布局文件java代码etContent.setImeOptions(EditorInfo.IME_ACTION_SEND);etContent.setInputType(TY
- 进阶1-2 android常用控件综述
我在西边等太阳
笔记进阶1android
这里主要根据书本知识网络知识和使用过的控件及好用的第三方控件做一个总结统计,肯定不全面,但一下也想不到多少。一步步写下去发现真的是越基础的控件越精彩,因为现在有很多封装好的控件很少会去调原生的自己写,但是多了解一点也没有坏处。目录文本类1、TextView2、EditText3、AutoCompleteTextView(单项提示的自动完成文本框)4、MultiAutoCompleteTextVie
- 多线程编程之理财
周凡杨
java多线程生产者消费者理财
现实生活中,我们一边工作,一边消费,正常情况下会把多余的钱存起来,比如存到余额宝,还可以多挣点钱,现在就有这个情况:我每月可以发工资20000万元 (暂定每月的1号),每月消费5000(租房+生活费)元(暂定每月的1号),其中租金是大头占90%,交房租的方式可以选择(一月一交,两月一交、三月一交),理财:1万元存余额宝一天可以赚1元钱,
- [Zookeeper学习笔记之三]Zookeeper会话超时机制
bit1129
zookeeper
首先,会话超时是由Zookeeper服务端通知客户端会话已经超时,客户端不能自行决定会话已经超时,不过客户端可以通过调用Zookeeper.close()主动的发起会话结束请求,如下的代码输出内容
Created /zoo-739160015
CONNECTEDCONNECTED
.............CONNECTEDCONNECTED
CONNECTEDCLOSEDCLOSED
- SecureCRT快捷键
daizj
secureCRT快捷键
ctrl + a : 移动光标到行首ctrl + e :移动光标到行尾crtl + b: 光标前移1个字符crtl + f: 光标后移1个字符crtl + h : 删除光标之前的一个字符ctrl + d :删除光标之后的一个字符crtl + k :删除光标到行尾所有字符crtl + u : 删除光标至行首所有字符crtl + w: 删除光标至行首
- Java 子类与父类这间的转换
周凡杨
java 父类与子类的转换
最近同事调的一个服务报错,查看后是日期之间转换出的问题。代码里是把 java.sql.Date 类型的对象 强制转换为 java.sql.Timestamp 类型的对象。报java.lang.ClassCastException。
代码:
- 可视化swing界面编辑
朱辉辉33
eclipseswing
今天发现了一个WindowBuilder插件,功能好强大,啊哈哈,从此告别手动编辑swing界面代码,直接像VB那样编辑界面,代码会自动生成。
首先在Eclipse中点击help,选择Install New Software,然后在Work with中输入WindowBui
- web报表工具FineReport常用函数的用法总结(文本函数)
老A不折腾
finereportweb报表工具报表软件java报表
文本函数
CHAR
CHAR(number):根据指定数字返回对应的字符。CHAR函数可将计算机其他类型的数字代码转换为字符。
Number:用于指定字符的数字,介于1Number:用于指定字符的数字,介于165535之间(包括1和65535)。
示例:
CHAR(88)等于“X”。
CHAR(45)等于“-”。
CODE
CODE(text):计算文本串中第一个字
- mysql安装出错
林鹤霄
mysql安装
[root@localhost ~]# rpm -ivh MySQL-server-5.5.24-1.linux2.6.x86_64.rpm Preparing... #####################
- linux下编译libuv
aigo
libuv
下载最新版本的libuv源码,解压后执行:
./autogen.sh
这时会提醒找不到automake命令,通过一下命令执行安装(redhat系用yum,Debian系用apt-get):
# yum -y install automake
# yum -y install libtool
如果提示错误:make: *** No targe
- 中国行政区数据及三级联动菜单
alxw4616
近期做项目需要三级联动菜单,上网查了半天竟然没有发现一个能直接用的!
呵呵,都要自己填数据....我了个去这东西麻烦就麻烦的数据上.
哎,自己没办法动手写吧.
现将这些数据共享出了,以方便大家.嗯,代码也可以直接使用
文件说明
lib\area.sql -- 县及县以上行政区划分代码(截止2013年8月31日)来源:国家统计局 发布时间:2014-01-17 15:0
- 哈夫曼加密文件
百合不是茶
哈夫曼压缩哈夫曼加密二叉树
在上一篇介绍过哈夫曼编码的基础知识,下面就直接介绍使用哈夫曼编码怎么来做文件加密或者压缩与解压的软件,对于新手来是有点难度的,主要还是要理清楚步骤;
加密步骤:
1,统计文件中字节出现的次数,作为权值
2,创建节点和哈夫曼树
3,得到每个子节点01串
4,使用哈夫曼编码表示每个字节
- JDK1.5 Cyclicbarrier实例
bijian1013
javathreadjava多线程Cyclicbarrier
CyclicBarrier类
一个同步辅助类,它允许一组线程互相等待,直到到达某个公共屏障点 (common barrier point)。在涉及一组固定大小的线程的程序中,这些线程必须不时地互相等待,此时 CyclicBarrier 很有用。因为该 barrier 在释放等待线程后可以重用,所以称它为循环的 barrier。
CyclicBarrier支持一个可选的 Runnable 命令,
- 九项重要的职业规划
bijian1013
工作学习
一. 学习的步伐不停止 古人说,活到老,学到老。终身学习应该是您的座右铭。 世界在不断变化,每个人都在寻找各自的事业途径。 您只有保证了足够的技能储
- 【Java范型四】范型方法
bit1129
java
范型参数不仅仅可以用于类型的声明上,例如
package com.tom.lang.generics;
import java.util.List;
public class Generics<T> {
private T value;
public Generics(T value) {
this.value =
- 【Hadoop十三】HDFS Java API基本操作
bit1129
hadoop
package com.examples.hadoop;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FSDataInputStream;
import org.apache.hadoop.fs.FileStatus;
import org.apache.hadoo
- ua实现split字符串分隔
ronin47
lua split
LUA并不象其它许多"大而全"的语言那样,包括很多功能,比如网络通讯、图形界面等。但是LUA可以很容易地被扩展:由宿主语言(通常是C或 C++)提供这些功能,LUA可以使用它们,就像是本来就内置的功能一样。LUA只包括一个精简的核心和最基本的库。这使得LUA体积小、启动速度快,从 而适合嵌入在别的程序里。因此在lua中并没有其他语言那样多的系统函数。习惯了其他语言的字符串分割函
- java-从先序遍历和中序遍历重建二叉树
bylijinnan
java
public class BuildTreePreOrderInOrder {
/**
* Build Binary Tree from PreOrder and InOrder
* _______7______
/ \
__10__ ___2
/ \ /
4
- openfire开发指南《连接和登陆》
开窍的石头
openfire开发指南smack
第一步
官网下载smack.jar包
下载地址:http://www.igniterealtime.org/downloads/index.jsp#smack
第二步
把smack里边的jar导入你新建的java项目中
开始编写smack连接openfire代码
p
- [移动通讯]手机后盖应该按需要能够随时开启
comsci
移动
看到新的手机,很多由金属材质做的外壳,内存和闪存容量越来越大,CPU速度越来越快,对于这些改进,我们非常高兴,也非常欢迎
但是,对于手机的新设计,有几点我们也要注意
第一:手机的后盖应该能够被用户自行取下来,手机的电池的可更换性应该是必须保留的设计,
- 20款国外知名的php开源cms系统
cuiyadll
cms
内容管理系统,简称CMS,是一种简易的发布和管理新闻的程序。用户可以在后端管理系统中发布,编辑和删除文章,即使您不需要懂得HTML和其他脚本语言,这就是CMS的优点。
在这里我决定介绍20款目前国外市面上最流行的开源的PHP内容管理系统,以便没有PHP知识的读者也可以通过国外内容管理系统建立自己的网站。
1. Wordpress
WordPress的是一个功能强大且易于使用的内容管
- Java生成全局唯一标识符
darrenzhu
javauuiduniqueidentifierid
How to generate a globally unique identifier in Java
http://stackoverflow.com/questions/21536572/generate-unique-id-in-java-to-label-groups-of-related-entries-in-a-log
http://stackoverflow
- php安装模块检测是否已安装过, 使用的SQL语句
dcj3sjt126com
sql
SHOW [FULL] TABLES [FROM db_name] [LIKE 'pattern']
SHOW TABLES列举了给定数据库中的非TEMPORARY表。您也可以使用mysqlshow db_name命令得到此清单。
本命令也列举数据库中的其它视图。支持FULL修改符,这样SHOW FULL TABLES就可以显示第二个输出列。对于一个表,第二列的值为BASE T
- 5天学会一种 web 开发框架
dcj3sjt126com
Web框架framework
web framework层出不穷,特别是ruby/python,各有10+个,php/java也是一大堆 根据我自己的经验写了一个to do list,按照这个清单,一条一条的学习,事半功倍,很快就能掌握 一共25条,即便很磨蹭,2小时也能搞定一条,25*2=50。只需要50小时就能掌握任意一种web框架
各类web框架大同小异:现代web开发框架的6大元素,把握主线,就不会迷路
建议把本文
- Gson使用三(Map集合的处理,一对多处理)
eksliang
jsongsonGson mapGson 集合处理
转载请出自出处:http://eksliang.iteye.com/blog/2175532 一、概述
Map保存的是键值对的形式,Json的格式也是键值对的,所以正常情况下,map跟json之间的转换应当是理所当然的事情。 二、Map参考实例
package com.ickes.json;
import java.lang.refl
- cordova实现“再点击一次退出”效果
gundumw100
android
基本的写法如下:
document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
//navigator.splashscreen.hide();
document.addEventListener("b
- openldap configuration leaning note
iwindyforest
configuration
hostname // to display the computer name
hostname <changed name> // to change
go to: /etc/sysconfig/network, add/modify HOSTNAME=NEWNAME to change permenately
dont forget to change /etc/hosts
- Nullability and Objective-C
啸笑天
Objective-C
https://developer.apple.com/swift/blog/?id=25
http://www.cocoachina.com/ios/20150601/11989.html
http://blog.csdn.net/zhangao0086/article/details/44409913
http://blog.sunnyxx
- jsp中实现参数隐藏的两种方法
macroli
JavaScriptjsp
在一个JSP页面有一个链接,//确定是一个链接?点击弹出一个页面,需要传给这个页面一些参数。//正常的方法是设置弹出页面的src="***.do?p1=aaa&p2=bbb&p3=ccc"//确定目标URL是Action来处理?但是这样会在页面上看到传过来的参数,可能会不安全。要求实现src="***.do",参数通过其他方法传!//////
- Bootstrap A标签关闭modal并打开新的链接解决方案
qiaolevip
每天进步一点点学习永无止境bootstrap纵观千象
Bootstrap里面的js modal控件使用起来很方便,关闭也很简单。只需添加标签 data-dismiss="modal" 即可。
可是偏偏有时候需要a标签既要关闭modal,有要打开新的链接,尝试多种方法未果。只好使用原始js来控制。
<a href="#/group-buy" class="btn bt
- 二维数组在Java和C中的区别
流淚的芥末
javac二维数组数组
Java代码:
public class test03 {
public static void main(String[] args) {
int[][] a = {{1},{2,3},{4,5,6}};
System.out.println(a[0][1]);
}
}
运行结果:
Exception in thread "mai
- systemctl命令用法
wmlJava
linuxsystemctl
对比表,以 apache / httpd 为例 任务 旧指令 新指令 使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service 使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service 检查服务状态 service h