Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Google Sign In with OpenID
Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.

image stuck on screen even after closing app

thephotographerthephotographer Posts: 157Registered Users
hi,

i have 2 images in my app that rotate. they are png images, and they rotate forever. after the images have been on screen for a little while they get stuck on the screen.. the bizarre thing is, if i were to describe what it looks like, its exactly like burn in on a plasma screen, except in this case its a rotating image not a stationary image. the longer this spinning png image is on the screen, the more visible it is once the image is removed from the screen, and the longer it takes for it to fade away.

even after closing the app completely, close it, delete it, the image is still half visible on the screen, no matter what is open, this app, the springboard, another app. over the next minute or 2 depending on how long it was originally on screen for, the image fades away until nothing can be seen.

heres the code for the animation for the image
CABasicAnimation *aninmateRotating = [CABasicAnimation animationWithKeyPath:@\"transform.rotation\"];
aninmateRotating.fromValue = [NSNumber numberWithFloat:0];
aninmateRotating.toValue = [NSNumber numberWithFloat:[[configDict valueForKey:krotatingAngle] floatValue]];
aninmateRotating.duration = [[configDict valueForKey:kduration] floatValue];
//fullRotation.timeOffset = [[imageLayersItem valueForKey:imageLayerRotatingTimeOffset] floatValue];
if ([configDict valueForKey:krepeatCount] != nil)
{
if ([[configDict valueForKey:krepeatCount] isEqualToString:@\"forever\"] == YES)
aninmateRotating.repeatCount = HUGE_VALF;
else
aninmateRotating.repeatCount = [[configDict valueForKey:krepeatCount] floatValue];
}
[view.layer addAnimation:aninmateRotating forKey:@\"360\"];


when the page comes on screen, the spinning images are hidden, they are behind a rub to reveal layer. rubbing the screens makes the top image disappear revealing these images underneath. i am unsure if that has anything to do with the issue.

the issue happens both on ios 4 and ios 5.
Post edited by thephotographer on

Replies

  • sumosumo84sumosumo84 Posts: 139Registered Users
    it could be the device's screen. as what your describing basically breaks every rule in the book. try it on a different device, or if you have no other device try a simulator. but if what your saying is true, that its not your screen. ios has a prettttyy huge bug. haha. or if your willing to at least post all of the problem code so we can try it out. its all up to you.
  • thephotographerthephotographer Posts: 157Registered Users
    sumosumo84;391016 said:
    it could be the device's screen. as what your describing basically breaks every rule in the book. try it on a different device, or if you have no other device try a simulator. but if what your saying is true, that its not your screen. ios has a prettttyy huge bug. haha. or if your willing to at least post all of the problem code so we can try it out. its all up to you.
    ive tried it on both my ipad 2 with ios5, and my ipad 1 with ios 4.3.3. 2 different models, and 2 different major operating systems, both do it exactly the same.

    thats pretty much what i thought, what i described "should be impossible" as far as im aware, no matter what happens, (as long as u stay within the apple guidelines and use public api's), the app should not be able to affect the rest of the operating system or other apps. when the app is closed it should be finished. am i correct in saying that?
  • Duncan CDuncan C Posts: 8,031Tutorial Authors, Registered Users
    thephotographer;390977 said:
    hi,

    i have 2 images in my app that rotate. they are png images, and they rotate forever. after the images have been on screen for a little while they get stuck on the screen.. the bizarre thing is, if i were to describe what it looks like, its exactly like burn in on a plasma screen, except in this case its a rotating image not a stationary image. the longer this spinning png image is on the screen, the more visible it is once the image is removed from the screen, and the longer it takes for it to fade away.

    even after closing the app completely, close it, delete it, the image is still half visible on the screen, no matter what is open, this app, the springboard, another app. over the next minute or 2 depending on how long it was originally on screen for, the image fades away until nothing can be seen.

    heres the code for the animation for the image
    CABasicAnimation *aninmateRotating = [CABasicAnimation animationWithKeyPath:@\"transform.rotation\"];
    aninmateRotating.fromValue = [NSNumber numberWithFloat:0];
    aninmateRotating.toValue = [NSNumber numberWithFloat:[[configDict valueForKey:krotatingAngle] floatValue]];
    aninmateRotating.duration = [[configDict valueForKey:kduration] floatValue];
    //fullRotation.timeOffset = [[imageLayersItem valueForKey:imageLayerRotatingTimeOffset] floatValue];
    if ([configDict valueForKey:krepeatCount] != nil)
    {
    if ([[configDict valueForKey:krepeatCount] isEqualToString:@\"forever\"] == YES)
    aninmateRotating.repeatCount = HUGE_VALF;
    else
    aninmateRotating.repeatCount = [[configDict valueForKey:krepeatCount] floatValue];
    }
    [view.layer addAnimation:aninmateRotating forKey:@\"360\"];


    when the page comes on screen, the spinning images are hidden, they are behind a rub to reveal layer. rubbing the screens makes the top image disappear revealing these images underneath. i am unsure if that has anything to do with the issue.

    the issue happens both on ios 4 and ios 5.

    What is "view" who's layer you're installing the animation into? A UIWindow is a subclass of UIView, so you could probably install an animation into the window's layer and screw things up.

    My guess is that somehow you are reaching down to the CA layer for the actual screen rather than the layer for your view.

    You might want to add a container view inside your view controller's content view, and add your animation to that new view instead of directly to your view controller's content view. (That's assuming you are adding the animation directly to the layer belonging to the view controller's content view.

    In Mac OS there is a parameter you use when you create a window to control the "depth" of the window in the window hierarchy. This lets you create floating windows that float above all other application windows, and is how the system does system alerts that float in front of EVERYTHING.

    Is there something like that with layers in iOS, and are you pushing your "spinners" view down below your applications layers?
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • thephotographerthephotographer Posts: 157Registered Users
    the above code is a generic class method i have created, and i can call that method on any view i wish. generally it would only be called on a UIImageView (either a static image or an image sequence), maybe a uiview containing images, could be a uiview containing a video etc. im 98% of the way through building my own entire magazine platform, similar to the adobe digital publishing suite, but mine is much more versatile and customisable, with many more features.

    + (void)animateRotatingForView:(UIView*)view withConfig:(NSDictionary*)configDict
    {
    CABasicAnimation *aninmateRotating = [CABasicAnimation animationWithKeyPath:@\"transform.rotation\"];
    aninmateRotating.fromValue = [NSNumber numberWithFloat:0];
    aninmateRotating.toValue = [NSNumber numberWithFloat:[[configDict valueForKey:krotatingAngle] floatValue]];
    aninmateRotating.duration = [[configDict valueForKey:kduration] floatValue];
    //fullRotation.timeOffset = [[imageLayersItem valueForKey:imageLayerRotatingTimeOffset] floatValue];
    if ([configDict valueForKey:krepeatCount] != nil)
    {
    if ([[configDict valueForKey:krepeatCount] isEqualToString:@\"forever\"] == YES)
    aninmateRotating.repeatCount = HUGE_VALF;
    else
    aninmateRotating.repeatCount = [[configDict valueForKey:krepeatCount] floatValue];
    }
    [view.layer addAnimation:aninmateRotating forKey:@\"360\"];
    }


    in this particular example the view being passed to the method is a UIImageView, and is in the heirachy as follows

    window > viewcontroller > view > scrollview > scrollview > view >UIImageView.

    i have 2 of these images on the page, png's, they are the spinning wheels on a car.
  • Duncan CDuncan C Posts: 8,031Tutorial Authors, Registered Users
    thephotographer;391217 said:
    the above code is a generic class method i have created, and i can call that method on any view i wish. generally it would only be called on a UIImageView (either a static image or an image sequence), maybe a uiview containing images, could be a uiview containing a video etc. im 98% of the way through building my own entire magazine platform, similar to the adobe digital publishing suite, but mine is much more versatile and customisable, with many more features.

    + (void)animateRotatingForView:(UIView*)view withConfig:(NSDictionary*)configDict
    {
    CABasicAnimation *aninmateRotating = [CABasicAnimation animationWithKeyPath:@\"transform.rotation\"];
    aninmateRotating.fromValue = [NSNumber numberWithFloat:0];
    aninmateRotating.toValue = [NSNumber numberWithFloat:[[configDict valueForKey:krotatingAngle] floatValue]];
    aninmateRotating.duration = [[configDict valueForKey:kduration] floatValue];
    //fullRotation.timeOffset = [[imageLayersItem valueForKey:imageLayerRotatingTimeOffset] floatValue];
    if ([configDict valueForKey:krepeatCount] != nil)
    {
    if ([[configDict valueForKey:krepeatCount] isEqualToString:@\"forever\"] == YES)
    aninmateRotating.repeatCount = HUGE_VALF;
    else
    aninmateRotating.repeatCount = [[configDict valueForKey:krepeatCount] floatValue];
    }
    [view.layer addAnimation:aninmateRotating forKey:@\"360\"];
    }


    in this particular example the view being passed to the method is a UIImageView, and is in the heirachy as follows

    window > viewcontroller > view > scrollview > scrollview > view >UIImageView.

    i have 2 of these images on the page, png's, they are the spinning wheels on a car.
    Dunno then. Sounds like a scary system bug. Post a radar bug report with Apple.
    Regards,

    Duncan C
    WareTo

    mug

    Animated GIF created with Face Dancer, available for free in the app store.
  • thephotographerthephotographer Posts: 157Registered Users
    doing the apple bug report now. the strange thing is its never done it on my iphone 4 or 3gs. but 100% repeatable on my ipads 1 and 2.

    ive recorded a video to show what is happening. normally it takes up to a minute or so for the burn in to happen, but for the purpose of the video i left it sit for a minute to burn in, then changed page back and forth to reset the rub and reveal, so i can show the process minus the minute wait for it to burn in.

    http://clintebbesen.com/download/apple%20bug%20spinning%20image%20stuck%20on%20scren%20after%20closing%20app.MOV
Sign In or Register to comment.