解决EditText在光标位置插入字符串,光标不会往后挪动的方法
keyStr = String.valueOf(keyCode);
// keyBoardEt.setText(""+keyStr);
int cursor = keyBoardEt.getSelectionStart();
keyBoardEt.getText().insert(cursor,keyStr+"");
真不知道网上那么多扯犊子的什么这配置那配置,在manifest设置,还有在 父布局设置,android已经很完善了一个属性就行的;
主要就是 两个属性:
android:enabled="false" //不能呼输入;
android:focusableInTouchMode="false" //没有onTouch焦点,不可点击;
<EditText
android:enabled="false"
android:focusableInTouchMode="false"
android:textCursorDrawable="@null"
android:id="@+id/keyBoardEt"
android:layout_width="514.0dip"
android:layout_height="wrap_content"
android:layout_marginTop="5.0dip"
android:background="@drawable/password_input"
android:ems="12"
android:paddingLeft="10.0dip"
android:textColor="#ff1c1c1c"
android:textSize="50.0sp" />
(mounting)是指由操作系统使一个存储设备(诸如硬盘、CD-ROM或共享资源)上的计算机文件和目录可供用户通过计算机的文件系统访问的一个过程。
一般来说,当计算机关机时,每个已挂载存储都将经历一次卸载,以确保所有排队的数据被写入,并保证介质上文件系统结构的完整性。
16进制 : 31 是 十进制 :49 ASCII:1;
在数据传输中,byte 是传输的基本形式,在java中转化为流进行数据传输,byte 是16进制的,再转10进制,相对应的ascii码;
其实是有一个符号的问题,下列是“你好”的byte,正负数是对应的;
-28,-67,-96,-27,-91,-67,
228,189,160,229,165,189,
android:inputType="none" <!--无格式-->
android:inputType="phone" <!--拨号键盘-->
android:inputType="text" <!--文本格式-->
android:inputType="textAutoComplete" <!--自动完成-->
android:inputType="textAutoCorrect" <!--纠正单词的拼写错误-->
android:inputType="textCapCharacters" <!--所有字符大写-->
android:inputType="textCapSentences" <!--仅第一个字母大写-->
android:inputType="textCapWords" <!--单词首字母大写-->
android:inputType="textEmailAddress" <!--电子邮件地址格式-->
android:inputType="textEmailSubject" <!--邮件主题格式-->
android:inputType="textFilter" <!--文本筛选格式-->
android:inputType="textImeMultiLine" <!--输入法多行-->
android:inputType="textLongMessage" <!--长消息格式-->
android:inputType="textMultiLine" <!--多行输入-->
android:inputType="textNoSuggestions" <!--不提示-->
android:inputType="textPassword" <!--密码格式-->
android:inputType="textPersonName" <!--人名格式-->
android:inputType="textPhonetic" <!--拼音输入格式-->
android:inputType="textPostalAddress" <!--邮政格式-->
android:inputType="textShortMessage" <!--短消息格式-->
android:inputType="textUri" <!--URI格式-->
android:inputType="textVisiblePassword" <!--密码可见格式-->
android:inputType="textWebEditText" <!--作为网页表单的文本格式-->
android:inputType="textWebEmailAddress" <!--作为网页表单的电子邮件地址格式-->
android:inputType="textWebPassword" <!--作为网页表单的密码格式-->
android:minLines="3" <!--设置最小行的行数-->
android:maxLines="10" <!--最大的行数,当输入内容超过maxlines,文字会自动向上滚动-->
android:singleLine="true" <!--限制EditText只允许单行输入,而且不会滚动-->
android:textScaleX="1.5" <!--设置字与字的水平间隔-->
android:textScaleY="1.5" <!--设置字与字的垂直间隔-->
android:capitalize="none" <!--sentences:仅第一个字母大写;words:每一个单词首字母大小、
用空格区分单词;characters:每一个英文字母都大写-->
android:imeOptions="actionNone"
<!--imeOptions有下面一些常用值-->
<!--actionUnspecified未指定,对应常量EditorInfo.IME_ACTION_UNSPECIFIED;-->
<!--actionNone 没有动作,对应常量EditorInfo.IME_ACTION_NONE;-->
<!--actionGo执行 “开始” ,对应常量EditorInfo.IME_ACTION_GO;-->
<!--actionSearch 执行 “搜索”,对应常量EditorInfo.IME_ACTION_SEARCH;-->
<!--actionSend执行 “发送”,对应常量EditorInfo.IME_ACTION_SEND;-->
<!--actionNext 执行 “下一个”,对应常量EditorInfo.IME_ACTION_NEXT;-->
<!--actionPrevious 执行 “上一个”,对应常量IME_ACTION_PREVIOUS;-->
<!--actionDone 执行 “完成”,对应常量EditorInfo.IME_ACTION_DONE-->
android:digits="1234567890" <!--设置允许输入哪些字符,如“1234567890.+-*/% ()”-->
android:numeric="integer" <!--设置仅仅能输入整数,假设是小数则是:decimal-->
android:password="true" <!--设置仅仅能输入密码-->
android:textColor="#ff8c00" <!--字体颜色-->
android:textStyle="bold" <!--字体 bold, italic, bolditalic-->
android:textSize="20dp" <!--设置输入文本内容字体大小-->
android:textAlign="center" <!--EditText没有这个属性,但TextView有,居中-->
android:typeface="monospace"
<!--字型,normal, sans, serif, monospace (标准、无衬线字体、衬线字体、等宽字体)-->
android:background="@null" <!--背景,这里设置null,意思为透明-->
android:layout_weight="1"
<!--权重,控制控件之间的地位,在控制控件显示的大小时蛮实用的-->
android:cursorVisible="true" <!--设定光标为显示/隐藏,默认显示-->
android:digits="1234567890" <!--设置允许输入哪些字符,如“1234567890.+-*/% ()”-->
android:drawableRight="@drawable/xxx" <!--在EditText的右边输出一个drawable-->
android:drawableTop="@drawable/xxx" <!--在EditText的正上方输出一个drawable-->
android:drawableBottom="@drawable/xxx" <!--在EditText的下方输出一个drawable-->
android:drawableLeft="@drawable/xxx" <!--在EditText的左边输出一个drawable-->
android:drawablePadding
<!--设置text与drawable(图片)的间隔,
与drawableLeft、drawableRight、drawableTop、drawableBottom一起使用,
可设置为负数,单独使用没有效果-->
android:editable="true" <!--设置是否可编辑,默认可以编辑-->
android:ellipsize="start"
<!--设置当文字过长时,该控件该怎样显示,例如设置以下值:
"start"省略号显示在开头,
"end"省略号显示在结尾,"middle"省略号显示在中间,
"marquee"以跑马灯的方式显示(动画横向移动)-->
android:gravity="center" <!--设置文本位置,如设置成"center",文本将居中显示-->
android:focusable="false" //这是不能点击
android:enabled="false"//这是不能输入,相当于死了