Ionic framework 离子键盘未正确打开
我正在爱奥尼亚创建一个登录屏幕。问题是,当我单击输入字段打开键盘时,它没有打开 然后我单击输入字段的外部,然后单击输入字段,然后键盘可见,或者我单击输入字段3到4次,然后键盘可见 我想在第一次单击输入字段时打开键盘。我已经实现了聚焦代码,但它不起作用。有人有什么建议吗 这是密码 config.xmlIonic framework 离子键盘未正确打开,ionic-framework,ionic3,ionic4,Ionic Framework,Ionic3,Ionic4,我正在爱奥尼亚创建一个登录屏幕。问题是,当我单击输入字段打开键盘时,它没有打开 然后我单击输入字段的外部,然后单击输入字段,然后键盘可见,或者我单击输入字段3到4次,然后键盘可见 我想在第一次单击输入字段时打开键盘。我已经实现了聚焦代码,但它不起作用。有人有什么建议吗 这是密码 config.xml <?xml version='1.0' encoding='utf-8'?> <widget id="com.example" version="1.0.21" xmlns="ht
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>App Name </name>
<description>App Name</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<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="SplashMaintainAspectRatio" value="true" />
<preference name="SplashScreenDelay" value="0" />
<preference name="loadUrlTimeoutValue" value="60000" />
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="FadeSplashScreen" value="true" />
<preference name="UseSwiftLanguageVersion" value="4.2" />
<platform name="android">
<allow-intent href="market:*" />
<preference name="android-targetSdkVersion" value="28" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
</platform>
<platform name="ios">
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>To scan barcodes</string>
</edit-config>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-statusbar" spec="2.2.2" />
<plugin name="cordova-plugin-sslcertificatechecker" spec="5.1.0" />
<plugin name="cordova-plugin-certificates" spec="^0.6.4" />
<plugin name="cordova-plugin-http" spec="1.2.0" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic" spec="^2.0.4">
<variable name="APP_ID" value="e363211c" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="background" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.4.0" />
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-datepicker" spec="0.9.3" />
<allow-navigation href="http://192.168.2.26:8100" />
<engine name="ios" spec="5.0.0" />
<engine name="android" spec="6.3.0" />
<engine name="browser" spec="5.0.4" />
</widget>
<!-- Page content inputs -->
<ion-content padding class="background">
<ion-list>
<!-- logo on top of page -->
<ion-item no-lines justify-content-center align-items-center>
<ion-row justify-content-center align-items-center>
<ion-col>
<div style="text-align: center">
<img align='center' src="assets/icon/logo.png" height="140px" width="180px">
</div>
</ion-col>
</ion-row>
</ion-item>
<ion-item no-lines
style="height:40px; user-select: auto; padding-right:16px;border-style: solid; border-width: 1px;border-radius:3px;border-color: #E3e3e3">
<ion-label color="dark" item-left>
<ion-icon name="md-mail"></ion-icon>
</ion-label>
<ion-input style="user-select: auto" class="text_style" type="email" placeholder="Email"
[(ngModel)]="userEmail" name="userEmail"></ion-input>
</ion-item>
<!-- Password Field with show/hide option controls-->
<ion-item no-lines
style=" user-select: auto; padding-right:16px; border-style: solid; border-width: 1px;border-radius:3px;border-color: #E3e3e3">
<ion-label color="dark" item-left>
<ion-icon name="md-lock"></ion-icon>
</ion-label>
<ion-input style="user-select: auto" class="ion-input" [(ngModel)]="password" type="{{type}}"
placeholder="Password" name="password"></ion-input>
<button class="ion-input-button" *ngIf="!showPass" ion-button clear color="dark" type="button" item-right
(click)="showPassword()">
<ion-icon name="md-eye-off"></ion-icon>
</button>
<button class="ion-input-button" *ngIf="showPass" ion-button clear color="dark" type="button" item-right
(click)="showPassword()">
<ion-icon name="md-eye"></ion-icon>
</button>
</ion-item>
<!--Forgot Password Link -->
<ion-row>
<ion-col>
<!-- <ion-item> -->
<ion-row>
<ion-checkbox [(ngModel)]="rememberLogin" (ionChange)="keepMeLogin()"
style="margin-top:13px; margin-right:5px; margin-left:16px"></ion-checkbox>
<ion-label style="text-align:left; font-size: 12px; padding-top:4px">Remember Me</ion-label>
</ion-row>
</ion-col>
<ion-col>
<button ion-button clear color="button-color" style="text-align:right; font-size: 12px"
(click)="forgotPassword()" float-right>Forgot Password
</button>
</ion-col>
</ion-row>
<!--Login Button -->
<button style="height:48px" ion-button full color="button-color" (click)="onLogin()">Log in</button>
</ion-list>
<!-- </ion-card-content>
</ion-card> -->
<!-- Create New Account Link -->
</ion-content>
<!--End content -->
login.html
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.example" version="1.0.21" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>App Name </name>
<description>App Name</description>
<author email="hi@ionicframework" href="http://ionicframework.com/">Ionic Framework Team</author>
<content src="index.html" />
<allow-navigation href="*" />
<allow-intent href="*" />
<access origin="*" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<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="SplashMaintainAspectRatio" value="true" />
<preference name="SplashScreenDelay" value="0" />
<preference name="loadUrlTimeoutValue" value="60000" />
<preference name="android-windowSoftInputMode" value="adjustResize" />
<preference name="SplashScreen" value="screen" />
<preference name="AutoHideSplashScreen" value="true" />
<preference name="FadeSplashScreenDuration" value="300" />
<preference name="SplashShowOnlyFirstTime" value="true" />
<preference name="ShowSplashScreenSpinner" value="true" />
<preference name="FadeSplashScreen" value="true" />
<preference name="UseSwiftLanguageVersion" value="4.2" />
<platform name="android">
<allow-intent href="market:*" />
<preference name="android-targetSdkVersion" value="28" />
<icon density="ldpi" src="resources/android/icon/drawable-ldpi-icon.png" />
</platform>
<platform name="ios">
<edit-config file="*-Info.plist" mode="merge" target="NSCameraUsageDescription">
<string>To scan barcodes</string>
</edit-config>
<allow-intent href="itms:*" />
<allow-intent href="itms-apps:*" />
</platform>
<plugin name="cordova-plugin-device" spec="1.1.4" />
<plugin name="cordova-plugin-statusbar" spec="2.2.2" />
<plugin name="cordova-plugin-sslcertificatechecker" spec="5.1.0" />
<plugin name="cordova-plugin-certificates" spec="^0.6.4" />
<plugin name="cordova-plugin-http" spec="1.2.0" />
<plugin name="cordova-plugin-file" spec="^6.0.1" />
<plugin name="cordova-plugin-splashscreen" spec="^4.0.0" />
<plugin name="cordova-plugin-ionic" spec="^2.0.4">
<variable name="APP_ID" value="e363211c" />
<variable name="CHANNEL_NAME" value="Production" />
<variable name="UPDATE_METHOD" value="background" />
<variable name="UPDATE_API" value="https://api.ionicjs.com" />
<variable name="MAX_STORE" value="2" />
</plugin>
<plugin name="ionic-plugin-keyboard" spec="^2.2.1" />
<plugin name="cordova-plugin-x-socialsharing" spec="^5.4.0" />
<plugin name="cordova-plugin-whitelist" spec="1.3.3" />
<plugin name="cordova-plugin-datepicker" spec="0.9.3" />
<allow-navigation href="http://192.168.2.26:8100" />
<engine name="ios" spec="5.0.0" />
<engine name="android" spec="6.3.0" />
<engine name="browser" spec="5.0.4" />
</widget>
<!-- Page content inputs -->
<ion-content padding class="background">
<ion-list>
<!-- logo on top of page -->
<ion-item no-lines justify-content-center align-items-center>
<ion-row justify-content-center align-items-center>
<ion-col>
<div style="text-align: center">
<img align='center' src="assets/icon/logo.png" height="140px" width="180px">
</div>
</ion-col>
</ion-row>
</ion-item>
<ion-item no-lines
style="height:40px; user-select: auto; padding-right:16px;border-style: solid; border-width: 1px;border-radius:3px;border-color: #E3e3e3">
<ion-label color="dark" item-left>
<ion-icon name="md-mail"></ion-icon>
</ion-label>
<ion-input style="user-select: auto" class="text_style" type="email" placeholder="Email"
[(ngModel)]="userEmail" name="userEmail"></ion-input>
</ion-item>
<!-- Password Field with show/hide option controls-->
<ion-item no-lines
style=" user-select: auto; padding-right:16px; border-style: solid; border-width: 1px;border-radius:3px;border-color: #E3e3e3">
<ion-label color="dark" item-left>
<ion-icon name="md-lock"></ion-icon>
</ion-label>
<ion-input style="user-select: auto" class="ion-input" [(ngModel)]="password" type="{{type}}"
placeholder="Password" name="password"></ion-input>
<button class="ion-input-button" *ngIf="!showPass" ion-button clear color="dark" type="button" item-right
(click)="showPassword()">
<ion-icon name="md-eye-off"></ion-icon>
</button>
<button class="ion-input-button" *ngIf="showPass" ion-button clear color="dark" type="button" item-right
(click)="showPassword()">
<ion-icon name="md-eye"></ion-icon>
</button>
</ion-item>
<!--Forgot Password Link -->
<ion-row>
<ion-col>
<!-- <ion-item> -->
<ion-row>
<ion-checkbox [(ngModel)]="rememberLogin" (ionChange)="keepMeLogin()"
style="margin-top:13px; margin-right:5px; margin-left:16px"></ion-checkbox>
<ion-label style="text-align:left; font-size: 12px; padding-top:4px">Remember Me</ion-label>
</ion-row>
</ion-col>
<ion-col>
<button ion-button clear color="button-color" style="text-align:right; font-size: 12px"
(click)="forgotPassword()" float-right>Forgot Password
</button>
</ion-col>
</ion-row>
<!--Login Button -->
<button style="height:48px" ion-button full color="button-color" (click)="onLogin()">Log in</button>
</ion-list>
<!-- </ion-card-content>
</ion-card> -->
<!-- Create New Account Link -->
</ion-content>
<!--End content -->
记得我吗
忘记密码
登录
在我的设备中工作正常。我的设备是Redmi K20 Pro。在其他设备中部署相同的代码并检查一次。您是否也使用了相同的配置和包文件以及我在问题中提到的相同版本。而不是完全相同的配置。在爱奥尼亚4中尝试过。是的,这是我的观点,它不适用于相同的配置。我想知道原因。你找到解决办法了吗?