autolayout

[UIView _forgetDependentConstraint:]: message sent to deallocated instance

跟風遠走 提交于 2019-12-23 19:12:27
问题 I tried using NSZobie and all others. Still i face issues. can't able to find where app crashed. Please Help. thanks in advance. *** -[UIView _forgetDependentConstraint:]: message sent to deallocated instance 0x208e0010 (lldb) bt * thread #1: tid = 0x2503, 0x342b3468 CoreFoundation`___forwarding___ + 192, stop reason = EXC_BREAKPOINT (code=EXC_ARM_B`enter code here`REAKPOINT, subcode=0xdefe) frame #0: 0x342b3468 CoreFoundation`___forwarding___ + 192 frame #1: 0x3420af68 CoreFoundation`_

intrinsicContentSize causes infinite loop in special case

雨燕双飞 提交于 2019-12-23 18:35:05
问题 I made a container view i call SimpleStackView. The idea is simple, any subviews are stacked on top of eachother. The width of a SimpleStackView determines the width of its subviews, and the height of a SimpleStackView is determined by the height of its subviews. I do it in layoutSubviews where i call sizeThatFits on each subview and layout them on top of eachother using the returned heights. The sum of those heights also determine what is returned from both the sizeThatFits override and

UICollectionView - Autolayout with pinterest style layout

↘锁芯ラ 提交于 2019-12-23 18:18:29
问题 I am currently trying to build a pinterest style layout while having a dynamic height using autolayout (trying to stay away from manual calcuations of cell heights). I am currently aiming for iOS 9 and greater. I have seen brilliant examples of how to do a dynamic layout and a pinterest layout with calculations specific for each index but not with autolayout. Currently my thoughts are that the item would no its width, i.e. layout has x number of columns and an item could span y columns, so

Xcode 6.3.2 - Can't enter negative values in Layout Builder constraints

北城余情 提交于 2019-12-23 16:42:11
问题 My Xcode version is 6.3.2 (6D2105). Whenever I try to enter a negative value for any constraint constant in the Layout Builder, the value turns to 0. Even if the value was already negative and I've just changed the number itself, the value becomes 0. Update: Still happens on 7.3 (7D175). Machine: El Capitan 10.11.4 (15E65), running on VMWare MacOS 10.8 host. 回答1: Uncheck "Constrain to margins" checkbox in the pin menu while adding spacing to nearest neighbour for the new constraints. 来源:

XCODE keeps crashing. Deals with auto layout

人盡茶涼 提交于 2019-12-23 15:35:27
问题 I clicked to turn off auto layout. And now I click the check box to turn it on, and xcode immediately crashes..Every time. I'm pretty sure that all tableviews have a datasource. I can't work on the project! Please help. Process: Xcode [5748] Path: /Applications/Xcode.app/Contents/MacOS/Xcode Identifier: com.apple.dt.Xcode Version: 5.0 (3332.25) App Item ID: 497799835 App External ID: 38302662 Code Type: X86-64 (Native) Parent Process: launchd [144] User ID: 501 Date/Time: 2013-09-30 00:12:40

UICollectionViewCell not calling updateConstraints automatically when dequeued?

♀尐吖头ヾ 提交于 2019-12-23 09:33:30
问题 I have a UICollectionViewCell subclass. I wrote an updateConstraints method as I've done a hundred times before. For some reason that is never called when the cell is dequeued. I had to add a manual call to [cell setNeedsUpdateConstraints] after dequeueing it. Any idea what could be going on here? 回答1: Implement this method and return YES. This could probably help. + (BOOL)requiresConstraintBasedLayout For details: https://stackoverflow.com/a/23616469/1300262 来源: https://stackoverflow.com

Center contents of UIScrollview when using autolayout

血红的双手。 提交于 2019-12-23 09:29:15
问题 I'm using autolayout in my project and I have a scrollview that has a button centered in it. I have gotten the scrollview to scroll, but not to take up the entire screen. I've tried to follow the tutorial here: https://developer.apple.com/library/ios/technotes/tn2154/_index.html, as well as I have checked out a few similar questions on here. The issue is that I want the contents of the scrollview to center, rather than be pinned to the top/bottom/left/right. Here is my view hierarchy: Could

What method is called on UIView when it's resized by autolayout?

两盒软妹~` 提交于 2019-12-23 07:30:06
问题 I have an image view that I'm implementing rounded corners on by overriding the following in my subclass: -(void)setFrame:(CGRect)frame { [super setFrame:frame]; [self.layout setCornerRadius:frame.size.width/10.0]; } This works great for the initial display of the image, but if the size of the image changes due to device rotation or some other mechanism, this method does not get called to implement the resize. I'm using autolayout, and I want to know what method of UIView (and thus

View is not updating after changing auto-layout constraints programmatically

一世执手 提交于 2019-12-23 06:50:21
问题 Beforehand I have to say that I actually got the visible effect I've wanted but not in a satisfying way since, right now, constraints need to be "broken" instead of being properly updated. I got a ViewController which holds a UITableView. The height of that tableView can vary from 0 (not visible) to whatever the number of rows it holds is. The height is calculated in the ViewController's viewDidLoad() by multiplying the current number of rows by the row's height. The first thing I've tried

How can I set maximum width of a view in IOS?

蹲街弑〆低调 提交于 2019-12-23 06:49:19
问题 My app have a basic login screen, an outer box and in it, some textfield and buttons. I set the box to fill the screen. However, on some devices this box will to big. I want to set a maximum width and height to it. How do I set maximum width and height to a view? 回答1: You can use auto-layout constraints so that the box adapts to the screen size, but does not exceed a given width and height. To do this, set a "less than or equal to" constraint on the width and height. Add top, bottom, leading,