iOS模拟器中的奇异离子行为(odd Ionic behavior in iOS simulator)

编程入门 行业动态 更新时间:2024-10-13 20:18:36
iOS模拟器中的奇异离子行为(odd Ionic behavior in iOS simulator)

正在研究的离子应用程序在iOS模拟器(Xcode 7.2.1)中运行时有一些奇怪的行为。 正常运行时的登录屏幕如下所示:

但是,在编辑用户名字段时,我会在底部看到某种工具栏弹出窗口:

更糟糕的是,当我转到密码字段时:

我一开始以为这可能会处理本机WebView,但它只发生在模拟器中。 不是在实际设备上运行或通过ionic serve 。 有什么想法在这里发生了什么? 为何这种奇怪的行为?

编辑

此外,应用程序启动时使用默认的Cordova启动屏幕,即使我已经设置了Ionic飞溅。 即便如此,它应该显示离子飞溅而不是科尔多瓦飞溅。

编辑#2很多时候,Cordova状态栏无法工作,我的状态栏是黑色而不是白色。

AN Ionic application am a working on is having some odd behavior when run in the iOS simulator (Xcode 7.2.1). My login screen when normally run looks like:

When editing the username field however, I see some sort of toolbar popup at the bottom:

Worse then that however is when I go over to the password field:

I thought at first that this may deal with the native WebView, but it only happens in the simulator. Not when run on the actual device or through ionic serve. Any ideas what is going on here? Why this odd behavior?

EDIT

Also, the app launches with the default Cordova splash screen even though I have set a splash with Ionic. Even so, it should be showing the Ionic splash as opposed to the Cordova one.

EDIT #2 Many times, the Cordova status bar fails to work and my status bar is black as opposed to white.

最满意答案

虽然这对你来说在iOS模拟器中看起来很奇怪,而对于我在Chrome的设备模拟器开发工具中,它在Ionic中是“ 理想的行为 ”。

在此处输入图像描述

Ionic的设计考虑了移动设备,因此在模拟移动设备时,它们会隐藏元素以模拟原生键盘。

Ionic写了一篇关于此的博客文章 ,事实上:

由于几个原因,让键盘与网络层很好地配合使用具有挑战性。 可能最大的问题是显示键盘时设备和平台的行为变化。

在iOS中,当键盘在版本6.1,7.0和7.1中显示时,Web视图不仅会以不同方式调整大小,而且通过包含或排除视口元标记,它会受到不同的影响,有时则完全相反。 将平板电脑和横向方向的支持放入混合中并尝试使每个设备上的每个场景都能很好地工作,可以让您为每个修复的问题快速创建三个新问题。

博客文章继续说他们为Cordova编写了一个Keyboard插件,它应该更快,更准确地执行与键盘相关的隐藏和元素更改。 你可以在这里找到GitHub repo 。

While this looks weird for you in iOS Simulator, and for me in Chrome's device emulator devtool, it's 'desired behaviour' in Ionic.

enter image description here

Ionic is designed with mobile focus in mind, so when emulating a mobile device, they hide elements to simulate the native keyboard.

Ionic wrote a blog post about this, in fact:

Getting the keyboard to play nicely with the web layer was challenging for several reasons. Probably the biggest issue is the variation in behavior across devices and platforms when the keyboard is shown.

In iOS, not only does the web view resize differently when the keyboard shows in versions 6.1, 7.0, and 7.1, but it is affected differently, and sometimes completely oppositely, by including or excluding the viewport meta tag. Throw support for tablets and landscape orientation into the mix and trying to make every scenario on every device work nicely can have you quickly creating three new issues for every one you fix.

The blog post goes on to say they wrote a Keyboard plugin for Cordova, which is supposed to perform keyboard related hiding and element changing as faster and more accurately. You can find that GitHub repo here.

更多推荐

Cordova,Ionic,run,电脑培训,计算机培训,IT培训"/> <meta name="description

本文发布于:2023-04-29 01:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1334478.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:奇异   离子   器中   iOS   simulator

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!