简体   繁体   English

IOS版本11及更高版本的Ionic 1应用程序中的内容重叠

[英]Content overlaps in Ionic 1 app for IOS version 11 and above

I have a app built using Cordova, Ionic V1 and AngularJS V1 and in a particular control that is displaying date , content overlaps to the previous value. 我有一个使用Cordova,Ionic V1和AngularJS V1构建的应用程序并且在显示date的特定控件中,内容与先前的值重叠。 This issue is observed only in IOS 11.4.1 (latest release). 仅在IOS 11.4.1 (最新版本)中观察到此问题。 In the previous version IOS the control was working properly. 在先前版本的IOS中,控件运行正常。

I have attached the screen shot 我已附上屏幕截图

在此处输入图片说明

After inspecting in XCode I found out that this is a issue which is caused by display: block property. 在检查XCode之后,我发现这是由display:block属性引起的问题。 So I tried changing the value of display, most of the values says unsupported in IOS and which works is display: -webkit-box- . 因此,我尝试更改display的值,其中大多数值都表示IOS不支持,并且可以正常工作的是display:-webkit-box- But when I add that all the contents move to extreme left side that is Month, Date and Year values which I have highlighted in the image. 但是,当我添加所有内容时,所有内容都移到了最左侧,即我在图像中突出显示的月份,日期和年份值。

And below is the code 下面是代码

this.selectDate = function (date) {
        if (this.isDisabled(date)) return;
        this.selectedDate = angular.copy(date);
        this.selectedDate.setHours(0, 0, 0, 0);
        this.tempDate = angular.copy(this.selectedDate);
    };

Template code 模板代码

<div class=row>
  <div class="col datepicker-day-of-month" 
       ng-click="datepickerCtrl.changeType(\'date\')"> 
       {{datepickerCtrl.selectedDate | date: \'d\'}}
  </div>
</div>

The above code is part of ionic-datepicker link . 上面的代码是ionic-datepicker 链接的一部分

The date content works properly on Android has issue only in IOS V 11.4.1. 日期内容只能在IOS V 11.4.1中 在Android正常运行

Thanks :) 谢谢 :)

I have not tested it but I faced something similar issue. 我没有测试过,但是遇到了类似的问题。 Please try to replace <div> with <span> and see if it works: 请尝试将<div>替换为<span>然后查看是否可行:

<div class=row>
  <span class="col datepicker-day-of-month" 
       ng-click="datepickerCtrl.changeType(\'date\')"> 
       {{datepickerCtrl.selectedDate | date: \'d\'}}
  </span>
</div>

Also instead of display: block use display: inline . 也可以使用display: inline来代替display: block

Hope it will help you. 希望对您有帮助。

The issue is related to the display property value which does not support for IOS 11.4.1. 该问题与不支持IOS 11.4.1的显示属性值有关。

display: block;

The above property does not work in the latest version of IOS. 以上属性在最新版本的IOS中不起作用。

So I changed the value of the display property 所以我更改了显示属性的值

display: -webkit-inline-box !important;
text-align: -webkit-center !important;

text-align is used to align the div elements at the center. text-align用于将div元素居中对齐。

This solution works for both Android and IOS. 该解决方案适用于Android和IOS。

Hope this helps others. 希望这对其他人有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM