We currently have a problem that only seems to affect iOS7 devices.
In our .xib file, we have two views in the container view (i.e.: not at the top level of the view hierarchy) that should be displayed on the circle. Views have restrictions applied to their location and horizontal distance inside the container, and a aspect ratio condition that requires them to be square. Views should expand in width / height for large screen sizes, given the limitations described.
In our VC, we see the following: viewDidLayoutSubviews to make these views appear circular:
- (void)viewDidLayoutSubviews { self.progressContentContainerView.layer.cornerRadius = self.progressContentContainerView.frame.size.width/2; }
This seems to work on iOS8, however on iOS7 there is a period after the presentation of the view, where the restrictions have not yet been applied and the size of the view / views is incorrect (see attached screenshots). This resolves itself and correctly makes a circle in half a second. This only happens when the views that we intend to be circular are NOT at the top level of the hierarchy of VC views, which seems to imply that viewDidLayoutSubviews is called before the subheadings are also laid out.


I suggest that we could fix this problem by subclassing the UIView for the nested container by adding references to the circular view in this subclass and overriding viewDidLayoutSubviews here to make the cornerRadius setting. This seems like a workaround, and I am interested to know if there are other options.
Is there a cleaner and more idiomatic solution to this problem?
ios autolayout ios7
jmc
source share