Android键盘没有出现。 [英] Android keyboard does not come up.

查看:79
本文介绍了Android键盘没有出现。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写Android应用,但是当我触摸文本框时,键盘没有出现。触摸另一个文本框后,键盘出现。有人知道如何解决这个问题吗?

代码:

< EditText 
android:id =@ + id / login_usr
android:layout_width =wrap_content
android:layout_height =wrap_content
android:layout_alignParentLeft =true
android:layout_alignParentTop =true
android:layout_marginLeft =33dp
android:layout_marginTop =95dp
android:ems =10
android:inputType =text>

< requestFocus />
< / EditText>





编辑:Eclipse的LogCat告诉我,KeyCharacterMap:没有用于id 0的键盘

解决方案

虽然我看不到你的整个代码。但根据你上面的代码,我无法理解为什么你使用 android:removed =@ drawable / log_in这一行,它可能会导致问题(虽然我不确定)。

下面的代码在我的情况下工作正常。只需触摸编辑文本框后,键盘会自动出现在我的情况下。

 <   linearlayout     xmlns:android   =  http://schemas.android.com/apk/res/android >  
android:orientation =vertical
android:layout_width =fill_parent
android:layout_height =fill_parent
>

< edittext > ;
android:id =@ + id / edittext
android:layout_width =fill_parent
android:layout_height =wrap_content
/>
< / edittext > < / linearlayout >


I´m writing an Android app, but when I touch on the textbox, the keyboard doesn't come up. Just after touching on another textbox, the keyboard comes up. Somebody knows how to fix this?
code:

<EditText
    android:id="@+id/login_usr"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_alignParentTop="true"
    android:layout_marginLeft="33dp"
    android:layout_marginTop="95dp"
    android:ems="10"
    android:inputType="text" >

    <requestFocus />
</EditText>



Edit: LogCat of Eclipse tells me, KeyCharacterMap: no keyboard for id 0

解决方案

Though i can't see whole of your code.But according to your above code i can't understand why you use android:removed="@drawable/log_in" this line,it may cause problem(though i'm not sure).
Below code works fine in my case.Just after touching the edittext box, the keyboard comes up automatically for my case..

<linearlayout xmlns:android="http://schemas.android.com/apk/res/android">
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    >

<edittext>
    android:id="@+id/edittext"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    />
</edittext></linearlayout>


这篇关于Android键盘没有出现。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆