我的一个activity是用webview打开了一个网页 但是在网页的输入框里输入内容时软键盘弹出来当到了输入框,很不方便,在网上找了一些解决办法比如在manifest文件中加上android:windowSoftInputMode="stateHidden|adjustResize这句话 问题来了 设置全屏那句是隐藏系统标题栏 现在如果把隐藏系统标题栏这句删掉 就没问题了 ,如果加上这句隐藏系统标题栏 上边android:windowSoftInputMode="stateHidden|adjustResize这句话就不起作用了,现在我的这个activity要求是必须设置全屏,求高手解答困扰很长时间了

解决方案 »

  1.   

    设置全屏,可以有两种方法,如下:在代码中设置:
    public void onCreate(Bundle savedInstanceState) {   
            super.onCreate(savedInstanceState);   
               
            //设置无标题   
            requestWindowFeature(Window.FEATURE_NO_TITLE);   
            //设置全屏   
            getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,    
                    WindowManager.LayoutParams.FLAG_FULLSCREEN);   
               
            setContentView(R.layout.main);   
    }  
    在在manifest配置文件中设置
    <?xml version="1.0" encoding="utf-8"?>   
    <manifest xmlns:android="http://schemas.android.com/apk/res/android"  
          package="com.andyidea"  
          android:versionCode="1"  
          android:versionName="1.0">   
        <uses-sdk android:minSdkVersion="8" />   
      
        <application android:icon="@drawable/icon" android:label="@string/app_name">   
            <activity android:name=".login.LoginActivity"    
                      android:theme="@android:style/android.NoTitleBar.Fullscreen"  
                      android:label="@string/app_name">   
                <intent-filter>   
                    <action android:name="android.intent.action.MAIN" />   
                    <category android:name="android.intent.category.LAUNCHER" />   
                </intent-filter>   
            </activity>   
      
        </application>   至于你的那个软键盘,看一下通过设置全屏后,使用android:windowSoftInputMode="stateHidden|adjustResize能否达到你要的效果!
      

  2.   

    试试
    android:windowSoftInputMode="adjustPan"
      

  3.   

    2楼的哥们
    那种用代码写的全屏肯定是不行了 我试过了 你说的那种在配置文件里写的android:theme="@android:style/android.NoTitleBar.Fullscreen" 
    这放进去就报错啊theme里面就没有@android
      

  4.   

    我在webView外加了线性布局可是还是不管用啊
      

  5.   

    官方文档是这么写的:
    Window flag: hide all screen decorations (such as the status bar) while this window is displayed. This allows the window to use the entire display space for itself -- the status bar will be hidden when an app window with this flag set is on the top layer. A fullscreen window will ignore a value of SOFT_INPUT_ADJUST_RESIZE for the window's softInputMode field; the window will stay fullscreen and will not resize.http://developer.android.com/reference/android/view/WindowManager.LayoutParams.html#FLAG_FULLSCREEN