nslayoutconstraint

Unable to simultaneously satisfy constraints, will attempt to recover by breaking constraint

喜你入骨 提交于 2019-11-26 11:00:00
Below is the error message I receive in the debug area. It runs fine and nothing is wrong except that I receive this error. Would this prevent apple accepting the app? How do I fix it? 2012-07-26 01:58:18.621 Rolo[33597:11303] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't

Centering subview's X in autolayout throws “not prepared for the constraint”

拟墨画扇 提交于 2019-11-26 10:37:29
问题 I have a custom UIView subclass which is being initialized via a nib. In -awakeFromNib , I\'m creating a subview and attempting to center it in its superview. [self setInteralView: [[UIView alloc] init]]; [[self internalView] addConstraint: [NSLayoutConstraint constraintWithItem: [self internalView] attribute: NSLayoutAttributeCenterX relatedBy: NSLayoutRelationEqual toItem: self attribute: NSLayoutAttributeCenterX multiplier: 1 constant: 0]]; This breaks, and causes the following output:

UITextView inside UIScrollView with AutoLayout

时光怂恿深爱的人放手 提交于 2019-11-26 09:26:28
问题 I am trying to place UITextView inside UIScrollView with AutoLayout with no luck. What I have tried is, I placed UIScrollView inside the main view in Storyboard I placed UITextView inside UIScrollView in Storyboard and disabled Scrolling Enabled I set constraints (leading, trailing, top, bottom) on UIScrollView I set constraints (top, leading, trailing, height) on UITextView I created IBOutlet of height constraint of UITextView I set a text (a lot of text which can cause scrolling) on

Autolayout: Add constraint to superview and not Top Layout Guide?

孤街醉人 提交于 2019-11-26 09:17:22
问题 I have a UIView in my UIViewController in storyboard which I want to add a constraint on to space that view a distance from the top edge. Now, when I do the usual by ctrl + drag to the ViewController\'s main view I only get option to set it to top layout guide. This is a problem for me because at one point in the app Im going to move the main view up around 20-50px and what happens then is that view I have will not move... because its not aligned to superview. How can I manually do this in

UITableView within UIScrollView using autolayout

断了今生、忘了曾经 提交于 2019-11-26 08:43:08
问题 At the moment, I\'m using a UITableView along with other views that are contained in a UIScrollView . I want the UITableView to have its height to be the same as its content height. To complicate things, I\'m also inserting / deleting rows to provide an accordion effect so that when the user taps on a row, it will show more detail for that row. I\'ve got the insert / deletion done, though at the moment it doesn\'t update the UIScrollView which is its superview so that the content size of the

Unable to simultaneously satisfy constraints - No constraints in place

╄→гoц情女王★ 提交于 2019-11-26 07:58:56
问题 I have gone through and removed every single user constraint yet I am still getting the following error ONLY after I rotate the device. I have absolutely no clue why though. Does anyone have any ideas? 2013-01-14 21:30:31.363 myApp[35869:c07] Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following list is one you don\'t want. Try this: (1) look at each constraint and try to figure out which you don\'t expect; (2) find the code that added the

UITextView that expands to text using auto layout

北城以北 提交于 2019-11-26 07:53:11
问题 I have a view that is laid out completely using auto layout programmatically. I have a UITextView in the middle of the view with items above and below it. Everything works fine, but I want to be able to expand UITextView as text is added. This should push everything below it down as it expands. I know how to do this the \"springs and struts\" way, but is there an auto layout way of doing this? The only way I can think of is by removing and re-adding the constraint every time it needs to grow.

setNeedsLayout vs. setNeedsUpdateConstraints and layoutIfNeeded vs updateConstraintsIfNeeded

对着背影说爱祢 提交于 2019-11-26 07:50:59
问题 I know that the auto layout chain consists in basically 3 different process. updating constraints layout views (here is where we get calculation of frames) display What\'s is not totally clear to me is the inner difference between -setNeedsLayout and -setNeedsUpdateConstraints . From Apple Docs: setNeedsLayout Call this method on your application’s main thread when you want to adjust the layout of a view’s subviews. This method makes a note of the request and returns immediately. Because this

How to update the constant height constraint of a UIView programmatically?

橙三吉。 提交于 2019-11-26 07:26:12
问题 I have a UIView and I set the constraints using Xcode Interface Builder. Now I need to update that UIView\'s height constant programmatically. There is a function that goes like myUIView.updateConstraints() , but I don\'t know how to use it. 回答1: Select the height constraint from the Interface builder and take an outlet of it. So, when you want to change the height of the view you can use the below code. yourHeightConstraintOutlet.constant = someValue yourView.layoutIfNeeded() Method

iOS: How does one animate to new autolayout constraint (height)

。_饼干妹妹 提交于 2019-11-26 05:55:25
问题 I\'ve never worked with autolayout constraints before. I have a small new app I\'m working on and noticed that the NIB\'s views are defaulting to autolayout. So, I figured I\'d take the opportunity to work with it and try to figure out where Apple is going with this. First challenge: I need to resize an MKMapView and I\'d like to animate it to the new position. If I do this the way I\'m used to: [UIView animateWithDuration:1.2f animations:^{ CGRect theFrame = worldView.frame; CGRect newFrame