objective c - Wrong height when adding autolayout subview in iOS app -
I am trying to add a subview to an existing view. I am basically adding a subview to copy ActionSheet like this example:
This example works fine until I do autollection on custom ActionSheet. When I encounter some problems, I am adding a subview to a red scene, its height in this red scene, and the obstacles to the horizontal and vertical position.
My problem is that the height does not seem to be 4S And the right footage on 5S devices becomes taller than 4S to 5S. I expected that it would be the second way because 5S has more than 4Ss I
I add the subview with this code:
If I add a view by pressing it instead: Then, as a result, I expected the 4S was completely covered by the red view and in the 5s still there is some area above the red scene. What am I doing wrong here? Size does not change according to auto view Device screen and My suggestion uses automatic layouts to complete your view for supervision. The following code uses PureLayout: [self. View addSubview: self.customActionSheet.view]; [Self.customActionSheet viewWillAppear: NO];
[self.navigationController pushViewController: self.customActionSheet Animated: Yes];
[UINavigationController pushViewController: animated] will work because the navigation controller is the frame of view for you, the quick way to set the frame of your footage with the current view.
self.customActionSheet.view.frame = self.view.bounds; Do not see
: automatically, the system will implement it.
[self.view addSubview: self.customActionSheet.view] [self.customActionSheet.view autoPinEdgesToSuperviewEdgesWithInsets: UIEdgeInsetsZero];
Comments
Post a Comment