摘要: // 将EditText的光标定位到字符的最后面public void setEditTextCursorLocation(EditText editText) { CharSequence text = editText.getText(); if (text instanceof Spannable) { Spannable spanText = (Spannable) text; Selection.setSelection(spanText, text.length()); }} 阅读全文
posted @ 2013-01-31 13:23 zhangze 阅读(5450) 评论(0) 推荐(0)
摘要: 转http://blog.csdn.net/zaq123q/article/details/7477994在项目中,一进入一个页面, EditText默认就会自动获取焦点。那么如何取消这个默认行为呢?解决之道:在EditText的父级控件中找一个,设置成这样,就把EditText默认的行为截断了! xml 1 <LinearLayout 2 android:orientation="vertical" 3 android:focusable="true" 4 android:focusableInTouchMode="true" 阅读全文
posted @ 2013-01-31 13:21 zhangze 阅读(5746) 评论(0) 推荐(0)