edittext如何禁止输入法 , 已经是禁止编辑了,但是点击屏幕出现选择单词界面时,触宝输入法也就弹了出来,如何禁止,谢谢
解决方案 »
- 如何用一个会话群发短信
- Eclipse下安装ADT问题
- android上使用ijetty,提示jsp支持未配置错误
- 环境问题,Ubuntu上模拟器不能关闭,而且不能上网
- 一个项目创意,是否可行
- frameworke中的一个status_bar_expanded.xml问题
- 求助,我用smack+openfire进行安卓即时通信开发,在发送图片时出了问题
- tween动画Animation怎么用在一个继承View的类里的某个单独bitmap上?
- android 使用匿名内部类、,外部变量需要final修饰,如何解决求助
- android studio 给app上传头像错误
- The method setBackgroundDrawable(Drawable) from the type View is deprecated求解
- android 编码规范 问题
或者你可以TextView和edittext联合起来用,控制他们是否可见。
文本过长可以用跑马灯效果
笨办法啊 呵呵
可以啊override 的 ontouch
可以用
getLineForVertical(getScrollY() + (int)event.getY());
layout.getOffsetForHorizontal(line, (int)(event.getX()+getScrollX()));
获取 坐标和行 列的转换
@Override
public boolean onTouch(View v, MotionEvent event)
{
if (v == phoneEt) {
//隐藏输入法
int inType = phoneEt.getInputType(); // back up the input type
phoneEt.setInputType(android.text.InputType.TYPE_NULL); // disable soft input
phoneEt.onTouchEvent(event);// call native handler
phoneEt.setInputType(inType); // restore input type
}
}
可以啊override 的 ontouch
可以用
getLineForVertical(getScrollY() + (int)event.getY());
layout.getOffsetForHorizontal(line, (int)(event.getX()+getScrollX()));
获取 坐标和行 列的转换 getScrollY 有关于这个的例子么,我这里怎么显示那个不可用啊
// 3.0以下版本可以用editText.setInputType(InputType.TYPE_NULL)来实现。
// 3.0以上版本除了调用隐藏方法:setShowSoftInputOnFocus(false)
int sdkInt = Build.VERSION.SDK_INT;// 16 -- 4.1系统
Toast.makeText(getApplicationContext(), sdkInt + "", Toast.LENGTH_SHORT).show();
if (sdkInt >= 11)
{
Class<EditText> cls = EditText.class;
try
{
Method setShowSoftInputOnFocus = cls.getMethod("setShowSoftInputOnFocus", boolean.class);
setShowSoftInputOnFocus.setAccessible(false);
setShowSoftInputOnFocus.invoke(edt_text, false);
setShowSoftInputOnFocus.invoke(edt_text, false);
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
else
{
edt_text.setInputType(InputType.TYPE_NULL);
}
不知道是不是楼主要的 我是这样做的