autolayout

issue with reentering of view with [UIView(Geometry) _applyISEngineLayoutValues] in iOS8 but not iOS7

我是研究僧i 提交于 2019-12-22 17:53:10
问题 I am working on an app that was started by others and I believe started when iOS 5 was current. Most of the UI is code generated and does not use auto layout and constraints explicitly. However, there are some (later added) self contained UI elements, defined in a nib(xib) that use auto layout internally, which are contained by higher level views from the app (generated in code and not using auto layout). One section of code generates a composite image of one of these self contained elements,

Is it possible to pin a UIView's top to the bottom of the navigation bar?

和自甴很熟 提交于 2019-12-22 10:54:22
问题 I'm trying to position my UIView to be 20pt under the navigation bar, but when I set it relative to the view on the view controller it's still under the navigation bar at 20pt, and I don't want to hardcode it. Is it possible to position it away from the navigation bar? 回答1: Try adding contraint with TopLayoutGuide, The main difference between TopLayoutGuide and self.view is, top layout guide starts with bottom of status bar + bottom of navigation bar(if exist) , but self.view always start

Resize view with Auto Layout between 3.5 and 4 inch form factor

爷,独闯天下 提交于 2019-12-22 10:39:35
问题 I have a prototype tableview cell, with a custom view inside of the tableview cell. The view controller that contains the tableview will only be displayed in landscape mode. The goal is for the UIView that is inside of the tableview cell to resize it's width based on the form factor. So for example there might be a 20pt spacing on the left and right and then the uiview resizes it's width to fill the rest of the space. I'm hoping to do this with storyboard and autolayout. In 3.5 inch form

NSLayoutConstraint that would pin a view to the bottom edge of a superview

霸气de小男生 提交于 2019-12-22 10:12:20
问题 A reproducible example class ViewController: UIViewController { var created = false override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() if !created { let scrollView = UIScrollView() scrollView.backgroundColor = UIColor.grayColor() view.addSubview(scrollView) let kidView = UIView() kidView.backgroundColor = UIColor.redColor() kidView.translatesAutoresizingMaskIntoConstraints = false scrollView.addSubview(kidView) scrollView.translatesAutoresizingMaskIntoConstraints = false

“Magic Move” Effect Custom Transition

吃可爱长大的小学妹 提交于 2019-12-22 09:14:53
问题 I trying to get a custom transition between two View Controllers. First, here's a picture to illustrate what I want : I want a UICollectionViewCell to expand to the whole screen. In this cell, the subviews are placed with Autolayout in IB. I just want each subview to go to the new position. So I tried subview.frame = newSubview.frame in the animation block, but it doesn't work (because of Autolayout I think). I thought to delete the constraints while the animation is occuring, but it doesn't

Can iOS's auto layout rearrange UI widgets

烂漫一生 提交于 2019-12-22 08:59:08
问题 I have an app which has a different UI for portrait and landscape. I've heard wonderful things about Auto Layout but in all my readings it seems to handle simple cases, where UI widgets resize and reposition simply. In my UI UI widgets move. Is this a case where I should try and get auto layout to work or should I just make 2 xibs and be done with it? You can see in the portrait version that the green element is below the magenta one, but it is above it and next to the orange one in the

Regular / Regular spacing between views for all iPads and iPad Pro?

半世苍凉 提交于 2019-12-22 08:58:46
问题 I've recently been encountering a difference in the regular / regular sizing class among different iPads, here's my related question Regular / Regular position sizing constraints for all iPads, including iPad pro? Although I can use a multiplier and a constant to provide a margin, which is based on the device height, I can't now apply this approach to the spacing between views. Obviously, because I'm create a constraint between two views and can't therefore add the device height aka superview

Combining NSLayoutConstraints with CALayer backed views does not animate correctly

自作多情 提交于 2019-12-22 08:51:35
问题 I have an auto layout setup with an animation that alters a NSLayoutContraint constant value // set the slide in view's initial height to zero self.adViewHeightConstraint = [NSLayoutConstraint constraintWithItem:self.adContainerView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:0.0]; [self.view addConstraint:self.adViewHeightConstraint]; // later, set the slid in view's height to non-zero double

iOS Scroll View, Container View - auto layout issue

荒凉一梦 提交于 2019-12-22 08:49:45
问题 I'm using storyboards & auto layout. I have a Container View in a UIScrollView. The Container View allows me to layout a long (320, 1000) view in the storyboard. I set the content size of the UIScrollView to (320,1000). I pinned the following constraints on the ContainerView to the ScrollView: Width Equals: 320 Height Equals: 1,000 Top Space to: Superview Align Center X to: Superview Xcode insists on adding an additional Constraint. It adds a Bottom Space to: Superview Equals: -432 . It will

Animating UIView frame with constraints

若如初见. 提交于 2019-12-22 07:11:05
问题 I have an element in a UIView with a constraint that says it should always be 10 pixels from the bottom of the view. I am then attempting to animate this view's height so that it appears to slide down the screen. According to the constraint, the element should always be 10 pixels from the bottom of the view. This holds true when I add the view like so... printView *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"printView"]; [self addChildViewController:vc]; vc.view.frame =