nsautolayout

UIViewController hangs in Xcode 7

好久不见. 提交于 2020-01-17 02:19:10
问题 Not sure whether title is correct or not, I'm calling newViewController on button click but it is not rendering that. as it was working fine in Xcode 6.4 but in Xcode 7 its hangs the UI and not showing new view controller after pushViewController. this is the error logs which print on console 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

iOS 8 CGAffineTransformMakeScale + autolayout not working any more

冷暖自知 提交于 2020-01-04 06:27:50
问题 There seems to be a some post related to my problem but none seems to help. How do I adjust the anchor point of a CALayer, when Auto Layout is being used? I have a scaled preview of my app (as a tutorial), which the standard view (and viewcontroller) scaled down and shown on another view. ============= = = = --------- = = - - = = -Preview- = = - - = = --------- = = View = ============= For this I use this code: previewViewController.view.transform = CGAffineTransformMakeScale(scale*2, scale*2

Layout: How to use property in visual format

依然范特西╮ 提交于 2019-12-25 12:46:15
问题 I have two classes. Parent class has a property: @interface ParentVC @property (nonatomic, strong) UIImageView* logoImageView; @end So, now, I need to output this view with layout constraints in subclass. @interface ChildVC : ParentVC @end How to correct format string of visual format? @"V:|-(%i)-[self.logoImageView]" // wrong I found solution: UIView* selfLogoImageView = self.logoImageView; @"V:|-(%i)-[selfLogoImageView]" But is there any method without new variable? 回答1: Since you are using

Unable to interpret '|' character

大憨熊 提交于 2019-12-25 07:18:05
问题 I need your help because I dont understand what's going on with my auto constraints. The constraints of my switch make the app crash. When I remove them it work nicely. This is the error message that I get: Unable to interpret '|' character, because the related view doesn't have a superview H:|-100-[v0(35)]| thx for your help Here is my code : class selectionCustomCell: UITableViewCell{ var label: UILabel = { let attribution = UILabel() attribution.text = "Nom du label" attribution.textColor

Why auto layout constraints not working?

久未见 提交于 2019-12-24 03:05:40
问题 I'm setting constraints in IB like But when i run the app on iPhone4 it shows Why last three buttons not shown properly on iPhone4 screen?is there any mistake in my constraints ? Edit:- This is my view hierarchy:- UITabbarControlle -> UINavigationController -> UIViewController and tab bar controller is rootviewcontroller . Edit:- FYI there is no effect of any constraints on the screen(basically autolayout not working for me). 回答1: You have designed the buttons on 4 inch and you don't have

Strange exception in layouts

强颜欢笑 提交于 2019-12-20 10:34:38
问题 Try call this method: avatarIconImageView.setContentHuggingPriority(UILayoutPriorityDefaultLow, forAxis: UILayoutConstraintAxis.Horizontal) and catch this exception: Undefined symbols for architecture armv7: "_UILayoutPriorityDefaultLow", referenced from: __TFC13TCProject_iOS36TCAvatarWithCounterUniversalCellView22configureBodyCellViewsfS0_FT_T_ in TCAvatarUniversalCellView.o ld: symbol(s) not found for architecture armv7 clang: error: linker command failed with exit code 1 (use -v to see

UITableViewCell doesn't work unless I add views to a container view rather than contentView

浪子不回头ぞ 提交于 2019-12-13 18:09:05
问题 Background This is in reference to this post (TLDR; UITableViewCell heights should be calculated automatically if you are using Auto Layout properly). Problem If I add the views directly to contentView , I keep on getting this error: 018-11-25 02:17:33.514881+0200 [78571:855018] [LayoutConstraints] 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

Swift Constraints in Subclass

大憨熊 提交于 2019-12-12 03:44:23
问题 I was wondering if there was a way to access constraints from a subclass. I have a custom view. I'm not sure if I can access the constraint I already have set in the UI, so I tried just creating the constraint from the subclass itself. class PerformanceView: UIView { func initialize() { let heightConstraint = NSLayoutConstraint(item: self, attribute: .Height, relatedBy: .Equal, toItem: superview, attribute: .Height, multiplier: 0.47, constant: 0); superview.addConstraint(heightConstraint) } }

Objective-C: animating height constraint change not working

随声附和 提交于 2019-12-11 11:38:44
问题 I have two blocks of code, one working and the second not really. The first adds a view, constraints its height to 0 and then cancel this constraint in an animation block so it grows up. Works perfect. The second one is supposed to reactivate the 0 height constraint so that its height shrinks back to 0 and then remove it, but instead it is removed instantaneously. Here's the code: self.pickupAddressViewModel.infoViewBlock = ^(MandatoryPickupView * _Nonnull pickupView) { if (weakSelf

Can subviews resize their superview automatically with auto layout?

心已入冬 提交于 2019-12-10 13:06:05
问题 If you have a view with no constraints on it, and that view has a subview with left, right, top and bottom constraints of equal size, if the subview's size is increased is it possible for the superview's size to automatically increase to accommodate these constraints? Thanks. 回答1: Yes, you can do that, and it can be done without any code or subclassing. For instance, if you have a label embedded in a view (with numberOfLines = 0), and it has constraints to to all the sides of the superview,