Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8585741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:08:32+00:00 2026-06-11T22:08:32+00:00

Foreword, this isn’t me losing a view off screen because I did the transform

  • 0

Foreword, this isn’t me losing a view off screen because I did the transform wrong, it’s weirder.

Problem is, if I use an .m34 transform to achieve the perspective I need, the view hierarchy breaks, but remove the transform and it draws everything correctly.

Here’s an example.

I have a background image (subviewOne), a menu(subviewTwo), and an object on top of all of that which I apply the CATransform3D to (subviewThree).

Simple code:

CALayer *layer = subviewThree.layer;
CATransform3D perspectiveTransform = CATransform3DIdentity;
perspectiveTransform.m34 = -1.0 / 500;
layer.transform = perspectiveTransform;

Prior to applying this code, the view hierarchy was, and still is on iOS 5:

(bottom to top)
subviewOne->subviewTwo->subviewThree

After applying it, I end up with:

(bottom to top still)
subviewTwo->subviewOne->subviewThree

Now, subviewThree still has the perspective transform applied to it, and is in the correct spot, on top of everything else, same as on iOS5. However, the Menu/subviewTwo, is now hidden by the background image/subviewOne, and nothing I do will get it to be drawn on top of the subviewOne. No amount of insertSubviewAtIndex:, bringSubviewToFront, sendSubviewToBack, etc, will make the view draw correctly.

This is incredibly peculiar particularly because the views that are drawn out of order are NOT having any kind of CATransform3D applied to them.

I have verified this independently in two different apps and multiple devices 6 devices. iOS5 draws everything correctly, and if I remove those four lines, everything draws correctly, but nothing I’ve tried on iOS 6 stops the .m34 from breaking the view ordering. It’s not always as simplistic as the example I’ve provided, but this is the most demonstrable case I have witnessed.

Has anyone else experienced this, solved this?

Edit: More info for comment.

Yeah, typo with the extra *.

Figure there’s an Imageview, QuadCurve Menu, and Textview.

I was calling the method with the .m34 in the viewDidLoad, but swapped it to the viewDidAppear real quick to check for you.

Doesn’t matter. Don’t get me wrong, the subviews are listed in the correct order when you call

NSLog(@"%@", [self.view.subviews description]); 

They just aren’t drawn on screen correctly.

In desperation, I wrote some crazy weird code, and I discovered the following.

I can call the method that draws the menu on a 10 second delay,

[self performSelector:@selector(createQuadCurveMenu) withObject:nil afterDelay:10];

which ends in

[self.view addSubview:menu] 

As well as a totally superfluous

[self.view bringSubviewToFront:menu]

and it’s still drawn behind an imageView that is set as the lowest subview in the .xib.

I have verified this two ways. I can go into the .xib and set the imageView to hidden, and running again I can see the menu, now that the imageView isn’t covering it. I can also just comment out the code that applies the .m34 transform to the textView, and the menu then again correctly appears on top of the imageView. Again, none of this happens on iOS5 and iOS4.

At this point, I’m starting to think that it’s a bug inside iOS6 itself, and have been waiting for the NDA to expire so I can ask here if anyone else has experienced it.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T22:08:33+00:00Added an answer on June 11, 2026 at 10:08 pm

    Pretty sure this is an iOS 6 bug: I’ve blogged about it here: iOS 6 Rendering Bug: 3D-Rotation Causes Layers to Render Without Respect for View Hierarchy.

    Good news: You can work around the bug by setting zPositions on the affected layers: set the zPositions in increasing order of the view hierarchy. So if I’ve understood correctly, you want:

    subviewOne.layer.zPosition = 0;
    subviewTwo.layer.zPosition = 1000;
    subviewThree.layer.zPosition = 2000;
    

    Check out the blog for more info, including a link to the Open Radar version of the bug I’ve logged with Apple.

    Also, this might be considered a duplicate of this post: iOS 6 view hierarchy nightmare. It has the same bug source and solution, although the symptoms you both describe are different.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

A foreword note that this is for an assignment. A question has already been
foreword: I have a component, lets call it IView. This component is implemented by
Foreword tl;wr: This is a discussion. I am aware that this question is more
Edit: Updated code. Now works well enough. Foreword. I am an OpenGL newb tasked
Foreword: Although I don't think it's exactly a duplicate, feel free to close if
Foreword: I am not trying to write an alternative either to Subversion or to
I'm trying to use internal references to link an index atop my wiki page
Foreword: I want to allow users to define high quality document templates and then
Foreword Before asking a question that probably will pretend to downvoting (as it seems
Just a foreword: I'm not exactly clear on how a RNG actually works. If

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.