键盘消失时的Android白色背景 [英] Android White Background when keyboard fades away

查看:280
本文介绍了键盘消失时的Android白色背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

来自其他用户但相同的问题的视频

Video of the problem from a different user but its the same

http://imgur.com/ca2cNZv

我的背景图片设置如下:

I have a background image set as follows :

  .pane {
  background-image:  url("../img/inner-banner-bg.jpg");
  background-repeat: repeat;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  background-size: cover;
}

在我的config.xml中

And in my config.xml

<preference name="Fullscreen" value="false"/>

现在我遇到的问题是,当我点击完成/搜索后键盘逐渐消失时,在过渡期间键盘会留下白色背景,像0.5一样,看起来有点糟糕.

Now the problem I am having is when the keyboard fades away after I hit done / search, it leaves a white background for like 0.5 during the transition for the space the keyboard covered and it looks a bit bad.

关闭键盘时,它不会收缩,但会留出白色缝隙.我如何才能使键盘不缩小背景幕后的视图?

When the keyboard closes it unshrinks but leaves white gap. How can I get the keyboard to not shrink the view behind the backdrop ?

当我设置

<preference name="Fullscreen" value="true"/>

这没有发生.我也在使用离子插件键盘.

It doesn't happen. I am also using the Ionic Plugin Keyboard.

无论如何,我可以使键盘褪色的过渡不显示白色背景吗?

Anyway I can make the transition of the keyboard fading not display the white background ?

这是我的android设置

Edit : Here's my android settings

<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale" android:label="@string/activity_name" android:launchMode="singleTop" android:name="MainActivity" android:theme="@android:style/Theme.DeviceDefault.NoActionBar" android:windowSoftInputMode="adjustResize">
            <intent-filter android:label="@string/launcher_name">
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>

我的配置设置

  <access launch-external="yes" origin="geo:*"/>
  <allow-intent href="geo:*"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="android-minSdkVersion" value="16"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="SplashScreen" value="screen"/>
  <preference name="SplashScreenDelay" value="4000"/>
  <preference name="FadeSplashScreen" value="false"/>
  <preference name="ShowSplashScreenSpinner" value="true"/>
  <preference name="KeyboardShrinksView" value="false"/>

在Package.json中

And in the Package.json

  "dependencies": {
    "gulp": "^3.5.6",
    "gulp-sass": "^2.0.4",
    "gulp-concat": "^2.2.0",
    "gulp-minify-css": "^0.3.0",
    "gulp-rename": "^1.2.0"
  },
  "devDependencies": {
    "bower": "^1.3.3",
    "gulp-util": "^2.2.14",
    "shelljs": "^0.3.0"
  },
  "cordovaPlugins": [
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "cordova-plugin-statusbar",
    "cordova-plugin-geolocation",
    "cordova-plugin-network-information",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [
    "android",
    "ios"
  ]

在我的网络视图中,我使用离子视图和离子含量

In my web view I use ion-view and ion-content

<ion-view>
    <ion-content class="has-header has-tabs">

推荐答案

在AndroidManifest.xml文件中,尝试将windowSoftInputMode属性设置为

In AndroidManifest.xml file try to set windowSoftInputMode attribute to adjustNothing:

android:windowSoftInputMode="adjustNothing"

它适用于我的Ionic项目,可以避免在打开软键盘时调整Cordova Webview的大小.

It worked for my Ionic project, avoiding the resize of Cordova webview when soft keyboard is on.

这篇关于键盘消失时的Android白色背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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