CRToast icon indicating copy to clipboard operation
CRToast copied to clipboard

iOS 8, 1px gap

Open ghost opened this issue 11 years ago • 16 comments

Starting with iOS 8, i can see a 1px gap on top of the navigation bar. Looks like the status bar is coming through.

ghost avatar Sep 18 '14 16:09 ghost

Seeing the same thing happening. Anyone have a fix?

reez avatar Sep 23 '14 01:09 reez

Ah I see it at the top there right?

image

cruffenach avatar Sep 23 '14 02:09 cruffenach

Here is a screenshot made on my device. In my case it's a white line, probably the status bar coming through. bildschirmfoto 2014-09-23 um 05 57 12

ghost avatar Sep 23 '14 03:09 ghost

crtoast-iphone6-simulator-comparison-1 Here is a giant image from the iPhone 6 simulator. Left is no changes, right is adding a launch screen file so iOS 8 doesn't scale the app?

Ashton-W avatar Sep 23 '14 11:09 Ashton-W

Yeah I've got the same exact thing as agentcooper shows in screenshot

reez avatar Sep 23 '14 13:09 reez

Anyone find a fix on this yet by chance?

Thanks!

reez avatar Oct 01 '14 20:10 reez

Same thing

NSDictionary *options = @{
                                  kCRToastTextKey : message,
                                  kCRToastTextAlignmentKey : @(NSTextAlignmentCenter),
                                  kCRToastBackgroundColorKey : [UIColor appPinkColor],
                                  kCRToastAnimationInTypeKey : @(CRToastAnimationTypeGravity),
                                  kCRToastAnimationOutTypeKey : @(CRToastAnimationTypeLinear),
                                  kCRToastAnimationInDirectionKey : @(CRToastAnimationDirectionTop),
                                  kCRToastAnimationOutDirectionKey : @(CRToastAnimationDirectionBottom),
                                  kCRToastTimeIntervalKey : @5
                                  };

        [self showNotificationWithOptions:options
                          completionBlock:nil];

nspavlo avatar Oct 16 '14 20:10 nspavlo

Did anyone find a fix for this, or find out if a fix is coming?

Thanks!

reez avatar Nov 29 '14 03:11 reez

It seems to be related to the gravity entrance only. Or at least thats the way i can get it to consistently happen. Which ever side it comes in from ends up having a 1px gap.

For example if it comes in with gravity from the left, the left side will have a 1px gap.

dmiedema avatar Nov 30 '14 23:11 dmiedema

Ahh, gotcha. Have you found any workaround for it yet by chance?

reez avatar Dec 01 '14 00:12 reez

Not yet - I've been toying with it. Once i figure something out ill report back a fix.

Sent from my not an iPhone

On Nov 30, 2014, at 4:43 PM, Lov [email protected] wrote:

Ahh, gotcha. Have you found any workaround for it yet by chance?

— Reply to this email directly or view it on GitHub.

dmiedema avatar Dec 01 '14 01:12 dmiedema

Okay so i think i found a solution to at least what I could find. Again, the only time i could see the issue it was with the gravity animation type.

It appears that the default gravity's magnitude is (at least part of) the issue.

The issue can be recreated under iOS 7 for the in left animation (creating a 1px gap on the left side of the toast message) by setting kCRToastAnimationGravityMagnitudeKey to >= 0.5. To recreate it along the top of the notification the kCRToastAnimationGravityMagnitudeKey has to be >= 0.3.

To fix the issue under iOS 8, bumping the values up to <= 1.3 fixes the 1px gap along the top & <= 1.5 to fix the 1px gap along the side. Bumping the value up doesn't seem to have any adverse effects under iOS 7 either.

Now exactly why this works I'm not entirely sure yet but nonetheless it does seem to fix the issue and be a viable workaround.

dmiedema avatar Dec 01 '14 04:12 dmiedema

Yes that seemed to work great! Way to go! I got in the files you referenced and made the changes, and got no 1px gaps.

I see your #119 and was wondering if that was getting merged into the master? Because that would be great-

reez avatar Dec 02 '14 14:12 reez

Okay so i found a few bugs with my solution / implementation:

With Gravity animation in

Original Magnitude Cover (1.0)

4.0" portrait 4.0" landscape 4.7" portrait 4.7" landscape 5.5" portrait 5.5" landscape
Top
Bottom
Left
Right

Original Magnitude Push (1.0)

4.0" portrait 4.0" landscape 4.7" portrait 4.7" landscape 5.5" portrait 5.5" landscape
Top
Bottom
Left
Right

Updated Magnitude Cover (1.5)

4.0" portrait 4.0" landscape 4.7" portrait 4.7" landscape 5.5" portrait 5.5" landscape
Top
Bottom
Left
Right

Updated Magnitude Push (1.5)

4.0" portrait 4.0" landscape 4.7" portrait 4.7" landscape 5.5" portrait 5.5" landscape
Top
Bottom
Left ✘*
Right ✘*

* - Gap is on the top, not the sides.

So it isn't a perfect fix, hell it seems to really only fixes one use case so i'm not exactly sure how useful it really is.

dmiedema avatar Dec 02 '14 20:12 dmiedema

FWIW I tested a basic left -> right gravity animation on the iOS 9 simulator iPhone 6. Looks like the gap has changed from being on the left side,like the view has animated in too far to being on the right like it hasn't animated in far enough

dmiedema avatar Aug 27 '15 04:08 dmiedema

hi, guys! i found a problem 1px gab on tab. to fix this problem do not use CRToastAnimationTypeGravity in kCRToastAnimationInTypeKey, kCRToastAnimationOutTypeKey. just use CRToastAnimationTypeLinear then work perfect!

HanSJin avatar Mar 07 '16 07:03 HanSJin