2013-05-21 81 views
0

我里面有一个滚动视图键盘没有出现与滚动视图在web视图Android的

<?xml version="1.0" encoding="utf-8"?> 
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    xmlns:tools="http://schemas.android.com/tools" 
    android:layout_width="fill_parent" 
    android:layout_height="match_parent" 
    android:background="@android:color/white" 
    android:orientation="vertical" 
    > 


    <RelativeLayout 
     android:layout_width="match_parent" 
     android:layout_height="wrap_content" 
     android:background="@drawable/bg_header" 
     /> 

    <ScrollView 
     android:layout_width="fill_parent" 
     android:layout_height="match_parent" 
     > 

     <WebView 
      android:id="@+id/webView" 
      android:layout_width="wrap_content" 
      android:layout_height="wrap_content" 
      /> 

    </ScrollView> 

</LinearLayout> 

网页视图,但它不会让我点击窗体字段或编辑框在web视图一样登录字段等我把键盘

我试过删除scrollView。也许是因为一旦记录的值是我做的webView“记住”这些字段,这就是为什么键盘没有显示?我怎样才能解决这个

我应该怎么做:(

+0

你有没有在任何的Android设备上测试它,而不是模拟器。 –

+0

我在s2上工作....可能ScrollViw不会让它变得焦点吗?它开始时,我添加了scrollView,我无法删除scrollView –

+0

这里有什么使用RelativeLayout .lol ..可以不使用textview或其他东西 – Unknown

回答

0

你能检查这个吗?从这里读取

http://developer.android.com/guide/topics/manifest/activity-element.html

android:windowSoftInputMode=["stateUnspecified", 
             "stateUnchanged", "stateHidden", 
             "stateAlwaysHidden", "stateVisible", 
             "stateAlwaysVisible", "adjustUnspecified", 
             "adjustResize", "adjustPan"] > 

android:configChanges="orientation|keyboard" 

试试这个

InputMethodManager imm = (InputMethodManager)this.getSystemService(Service.INPUT_METHOD_SERVICE); 

隐藏

imm.hideSoftInputFromWindow(ed.getWindowToken(), 0); 

以显示

imm.showSoftInput(ed, 0); 
+0

当我点击记住时出现错误。我不得不卸载应用程序,使其工作。如何CAn我修复这个 –

+0

张贴您的代码.. – Unknown

1

在活动标签Android清单,看到它你给这个

android:configChanges="orientation|keyboard" 

您的代码可能有

android:configChanges="orientation|keyboardHidden" 

检查出来,并让我知道。

+0

没有工作,我没有隐藏键盘,但我添加了上面一个。当我添加scrollView时,问题开始,我无法删除scrollView,否则WebView将不会显示其内容 –

相关问题