- 在隐藏系统软键盘时,光标也消失了的处理方法
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杨辉三角
3213213333332132
java基础
package com.algorithm;
/**
* @Description 杨辉三角
* @author FuJianyong
* 2015-1-22上午10:10:59
*/
public class YangHui {
public static void main(String[] args) {
//初始化二维数组长度
int[][] y
- 《大话重构》之大布局的辛酸历史
白糖_
重构
《大话重构》中提到“大布局你伤不起”,如果企图重构一个陈旧的大型系统是有非常大的风险,重构不是想象中那么简单。我目前所在公司正好对产品做了一次“大布局重构”,下面我就分享这个“大布局”项目经验给大家。
背景
公司专注于企业级管理产品软件,企业有大中小之分,在2000年初公司用JSP/Servlet开发了一套针对中
- 电驴链接在线视频播放源码
dubinwei
源码电驴播放器视频ed2k
本项目是个搜索电驴(ed2k)链接的应用,借助于磁力视频播放器(官网:
http://loveandroid.duapp.com/ 开放平台),可以实现在线播放视频,也可以用迅雷或者其他下载工具下载。
项目源码:
http://git.oschina.net/svo/Emule,动态更新。也可从附件中下载。
项目源码依赖于两个库项目,库项目一链接:
http://git.oschina.
- Javascript中函数的toString()方法
周凡杨
JavaScriptjstoStringfunctionobject
简述
The toString() method returns a string representing the source code of the function.
简译之,Javascript的toString()方法返回一个代表函数源代码的字符串。
句法
function.
- struts处理自定义异常
g21121
struts
很多时候我们会用到自定义异常来表示特定的错误情况,自定义异常比较简单,只要分清是运行时异常还是非运行时异常即可,运行时异常不需要捕获,继承自RuntimeException,是由容器自己抛出,例如空指针异常。
非运行时异常继承自Exception,在抛出后需要捕获,例如文件未找到异常。
此处我们用的是非运行时异常,首先定义一个异常LoginException:
/**
* 类描述:登录相
- Linux中find常见用法示例
510888780
linux
Linux中find常见用法示例
·find path -option [ -print ] [ -exec -ok command ] {} \;
find命令的参数;
- SpringMVC的各种参数绑定方式
Harry642
springMVC绑定表单
1. 基本数据类型(以int为例,其他类似):
Controller代码:
@RequestMapping("saysth.do")
public void test(int count) {
}
表单代码:
<form action="saysth.do" method="post&q
- Java 获取Oracle ROWID
aijuans
javaoracle
A ROWID is an identification tag unique for each row of an Oracle Database table. The ROWID can be thought of as a virtual column, containing the ID for each row.
The oracle.sql.ROWID class i
- java获取方法的参数名
antlove
javajdkparametermethodreflect
reflect.ClassInformationUtil.java
package reflect;
import javassist.ClassPool;
import javassist.CtClass;
import javassist.CtMethod;
import javassist.Modifier;
import javassist.bytecode.CodeAtt
- JAVA正则表达式匹配 查找 替换 提取操作
百合不是茶
java正则表达式替换提取查找
正则表达式的查找;主要是用到String类中的split();
String str;
str.split();方法中传入按照什么规则截取,返回一个String数组
常见的截取规则:
str.split("\\.")按照.来截取
str.
- Java中equals()与hashCode()方法详解
bijian1013
javasetequals()hashCode()
一.equals()方法详解
equals()方法在object类中定义如下:
public boolean equals(Object obj) {
return (this == obj);
}
很明显是对两个对象的地址值进行的比较(即比较引用是否相同)。但是我们知道,String 、Math、I
- 精通Oracle10编程SQL(4)使用SQL语句
bijian1013
oracle数据库plsql
--工资级别表
create table SALGRADE
(
GRADE NUMBER(10),
LOSAL NUMBER(10,2),
HISAL NUMBER(10,2)
)
insert into SALGRADE values(1,0,100);
insert into SALGRADE values(2,100,200);
inser
- 【Nginx二】Nginx作为静态文件HTTP服务器
bit1129
HTTP服务器
Nginx作为静态文件HTTP服务器
在本地系统中创建/data/www目录,存放html文件(包括index.html)
创建/data/images目录,存放imags图片
在主配置文件中添加http指令
http {
server {
listen 80;
server_name
- kafka获得最新partition offset
blackproof
kafkapartitionoffset最新
kafka获得partition下标,需要用到kafka的simpleconsumer
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.
- centos 7安装docker两种方式
ronin47
第一种是采用yum 方式
yum install -y docker
 
- java-60-在O(1)时间删除链表结点
bylijinnan
java
public class DeleteNode_O1_Time {
/**
* Q 60 在O(1)时间删除链表结点
* 给定链表的头指针和一个结点指针(!!),在O(1)时间删除该结点
*
* Assume the list is:
* head->...->nodeToDelete->mNode->nNode->..
- nginx利用proxy_cache来缓存文件
cfyme
cache
user zhangy users;
worker_processes 10;
error_log /var/vlogs/nginx_error.log crit;
pid /var/vlogs/nginx.pid;
#Specifies the value for ma
- [JWFD开源工作流]JWFD嵌入式语法分析器负号的使用问题
comsci
嵌入式
假如我们需要用JWFD的语法分析模块定义一个带负号的方程式,直接在方程式之前添加负号是不正确的,而必须这样做:
string str01 = "a=3.14;b=2.71;c=0;c-((a*a)+(b*b))"
定义一个0整数c,然后用这个整数c去
- 如何集成支付宝官方文档
dai_lm
android
官方文档下载地址
https://b.alipay.com/order/productDetail.htm?productId=2012120700377310&tabId=4#ps-tabinfo-hash
集成的必要条件
1. 需要有自己的Server接收支付宝的消息
2. 需要先制作app,然后提交支付宝审核,通过后才能集成
调试的时候估计会真的扣款,请注意
- 应该在什么时候使用Hadoop
datamachine
hadoop
原帖地址:http://blog.chinaunix.net/uid-301743-id-3925358.html
存档,某些观点与我不谋而合,过度技术化不可取,且hadoop并非万能。
--------------------------------------------万能的分割线--------------------------------
有人问我,“你在大数据和Hado
- 在GridView中对于有外键的字段使用关联模型进行搜索和排序
dcj3sjt126com
yii
在GridView中使用关联模型进行搜索和排序
首先我们有两个模型它们直接有关联:
class Author extends CActiveRecord {
...
}
class Post extends CActiveRecord {
...
function relations() {
return array(
'
- 使用NSString 的格式化大全
dcj3sjt126com
Objective-C
格式定义The format specifiers supported by the NSString formatting methods and CFString formatting functions follow the IEEE printf specification; the specifiers are summarized in Table 1. Note that you c
- 使用activeX插件对象object滚动有重影
蕃薯耀
activeX插件滚动有重影
使用activeX插件对象object滚动有重影 <object style="width:0;" id="abc" classid="CLSID:D3E3970F-2927-9680-BBB4-5D0889909DF6" codebase="activex/OAX339.CAB#
- SpringMVC4零配置
hanqunfeng
springmvc4
基于Servlet3.0规范和SpringMVC4注解式配置方式,实现零xml配置,弄了个小demo,供交流讨论。
项目说明如下:
1.db.sql是项目中用到的表,数据库使用的是oracle11g
2.该项目使用mvn进行管理,私服为自搭建nexus,项目只用到一个第三方 jar,就是oracle的驱动;
3.默认项目为零配置启动,如果需要更改启动方式,请
- 《开源框架那点事儿16》:缓存相关代码的演变
j2eetop
开源框架
问题引入
上次我参与某个大型项目的优化工作,由于系统要求有比较高的TPS,因此就免不了要使用缓冲。
该项目中用的缓冲比较多,有MemCache,有Redis,有的还需要提供二级缓冲,也就是说应用服务器这层也可以设置一些缓冲。
当然去看相关实现代代码的时候,大致是下面的样子。
[java]
view plain
copy
print
?
public vo
- AngularJS浅析
kvhur
JavaScript
概念
AngularJS is a structural framework for dynamic web apps.
了解更多详情请见原文链接:http://www.gbtags.com/gb/share/5726.htm
Directive
扩展html,给html添加声明语句,以便实现自己的需求。对于页面中html元素以ng为前缀的属性名称,ng是angular的命名空间
- 架构师之jdk的bug排查(一)---------------split的点号陷阱
nannan408
split
1.前言.
jdk1.6的lang包的split方法是有bug的,它不能有效识别A.b.c这种类型,导致截取长度始终是0.而对于其他字符,则无此问题.不知道官方有没有修复这个bug.
2.代码
String[] paths = "object.object2.prop11".split("'");
System.ou
- 如何对10亿数据量级的mongoDB作高效的全表扫描
quentinXXZ
mongodb
本文链接:
http://quentinXXZ.iteye.com/blog/2149440
一、正常情况下,不应该有这种需求
首先,大家应该有个概念,标题中的这个问题,在大多情况下是一个伪命题,不应该被提出来。要知道,对于一般较大数据量的数据库,全表查询,这种操作一般情况下是不应该出现的,在做正常查询的时候,如果是范围查询,你至少应该要加上limit。
说一下,
- C语言算法之水仙花数
qiufeihu
c算法
/**
* 水仙花数
*/
#include <stdio.h>
#define N 10
int main()
{
int x,y,z;
for(x=1;x<=N;x++)
for(y=0;y<=N;y++)
for(z=0;z<=N;z++)
if(x*100+y*10+z == x*x*x
- JSP指令
wyzuomumu
jsp
jsp指令的一般语法格式: <%@ 指令名 属性 =”值 ” %>
常用的三种指令: page,include,taglib
page指令语法形式: <%@ page 属性 1=”值 1” 属性 2=”值 2”%>
include指令语法形式: <%@include file=”relative url”%> (jsp可以通过 include