FAQ Database Discussion Community


Dynamically size Table View Cells using Auto Layout constraints

ios,uitableview,autolayout,ios-autolayout
Update I have revised the question completely after my latest findings. Goal My goal is to implement the following effect: There is a simple table view The user selects a row The selected row expands, revealing another label below the original one Please note that I am aware, that this...

Autolayout constraint issue when device orientation gets changed

ios,xcode6.1,nsautolayout,ios-autolayout
I am facing an issue in auto layout. I want two buttons as shown in screenshot. I want them to show correctly in landscape mode also. 1) Buttons should be centre align horizontly. 2) Buttons should have equal width and height. 3) Button should have equal distance from the...

Autolayout: Incorrect frame sizes in ViewDidAppear

swift,ios8,xcode6,autolayout,ios-autolayout
I have a UIViewController for which I'm using Autolayout via IB to position and size its subviews. For some reason I was not getting the correct UIView layout and I decided to log all the subview sizes in the VC. I logged subview sizes in: viewDidLoad{ self.view.layoutIfNeeded() print(uiview.size) } viewDidLayoutSubviews{...

Automatically set UIView vertical size based on device vertical size (including Auto Layout changes)

ios,uiview,uiscrollview,ios-autolayout
I've been googling on this and can't seem to pinpoint an answer to the question that I have. I'm writing an app and would like the vertical space of a child UIView to maintain the height of the device or rotation of the parent device regardless of orientation and without...

Unable to unset a layout constraint in RubyMotion using Motion-Kit gem

ios,ruby,autolayout,rubymotion,ios-autolayout
I'm having the following scenario. In one case i need to layout an element to the left of the view, in another case the same view needs to be rendered to the right of the view. The two constraints are conflicting obviosuly. def action_style diameter = rmq.device.width*0.06 constraints do width.is...

How to make Auto Layout for Universal App

ios,objective-c,autolayout,ios-autolayout
I'm now doing an universal app; I faced a problems on auto layout; I need to make two views with same size on all devices; I worked on storyboard with view wAny hAny; and here the images I reach The problem on iPad the bottom view it's very big and...

AutoLayout: position of subview proportional to parent view

ios,objective-c,autolayout,ios-autolayout
Let's supose I have a UIImageView at y=10 while the screen is height:100. What constraints do I have to set if I want the image to be always for example at y:10% of the parent? Parent height:100 - UIImage y:10 Parent height:200 - UIImage y:20 Parent height:320 - UIImage y:32...

Animate image view inside a container view in iOS?

ios,objective-c,autolayout,nsautolayout,ios-autolayout
I'm trying to animate a image view inside a container view. Container view is square and aligned center of the screen. i do have a image view inside my container. position of my image view is shown in below screenshot.(super view is my container view) i want to animate the...

Autolayout detect when UIView got the frame

ios,ios7,autolayout,nsautolayout,ios-autolayout
I have UIView that has auto layout constraints. I create it with frame CGRectZero. So I don't the real size. It will depend on superview. But I want to know when my view get a frame that I can use for my calculation....

Shadows Persist in UITableView after reloadSections:

ios,uitableview,cocoa-touch,core-graphics,ios-autolayout
Due to our designer being a sadist, I have a UITableView with a segmented control that switches between two different types of cells in separate feeds. The cells are dequeued with different identifiers and classes — this all works fine. The cells share a parent but are different sizes and...

How to set multiple UIlabel in same line for all iphone devices

ios,ios8,xcode6.3,ios-autolayout
I am setting constraints for 4 UILabels but its not working properly in iphone 5s and it's showing properly in 6 and 6 plus. How to set proper constraints? its going right side in iphone 5s. First label, I have set x position and then space between labels. Then I...

iOS Autolayout Programmatically constraints using VFL

ios,objective-c,autolayout,ios-autolayout,visual-format-language
I wants to make a close button like this, I tried to pin button, but the button was shrinked or disappeared Here was code, Shrinked [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[btnClose(==10)]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil views:NSDictionaryOfVariableBindings(btnClose)]]; Disappeared with error [constraints addObjectsFromArray:[NSLayoutConstraint constraintsWithVisualFormat:@"H:[btnClose(==-10)]-|" options:NSLayoutFormatAlignAllCenterY metrics:nil...

iOS UITableView cells loading even if off screen

ios,uitableview,ios-autolayout
What would be possible issues having a UITableView load all of it's cells even though most are off screen? The custom cells are using Auto-Layout as well as the entire screen that the table view is in. This is happening in ios versions 8, 7, 6...

How to turn off or turn on the Autolayout in code

ios,objective-c,xcode,autolayout,ios-autolayout
My app became something weird when I use Autolayout on iOS 7,so I want to know is there any way I can turn off Autolayout in code ? Anyone can help ?

Can I do this with autolayout/size classes?

ios,iphone,ipad,xcode6,ios-autolayout
Can I do this with autolayout and size-classes in xcode 6 , and, if so, how do I accomplish it ? The view should have aspect ratio 7:6 and the 4 buttons should appear as is shown in below. ...

Self sizing cell just doesn't work for me

ios,objective-c,uitableview,ios-autolayout
I tried to follow the WWCD 2014 session 226, which introduced the way to realize self sizing cells in iOS 8 using auto layout, and it just doesn't work as it should. HHTableViewCell.h #import <UIKit/UIKit.h> @interface HHTableViewCell : UITableViewCell @property (strong, nonatomic)UILabel *title; @end HHTableViewCell.m #import "HHTableViewCell.h" @implementation HHTableViewCell @synthesize...