Questions tagged [ios-autolayout]

In iOS, Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.

In iOS, Auto Layout dynamically calculates the size and position of all the views in your view hierarchy, based on constraints placed on those views.

More info

1049 questions
2
votes
5 answers

How we can increase width of two button when we remove third button from view

I have view with three button with equal size. Each button take 1/3 part portion of view. Like this image: If I remove/hide one button then two button width should increase equally and take 1/2 portion of view. if I remove two button then one…
Manjeet Singh
  • 57
  • 1
  • 10
2
votes
1 answer

How to fix NSLayoutConstraint warnings when i active/deactive constrains?

I have a titleView in a storyboard. It's height should be adjusted by title. So i write code like this: - (void)adjustTitleView { if (self.actionTitle.length > 0) { self.titleViewHeight.active = NO; self.titleLabelTop.active =…
Chris Yim
  • 1,392
  • 11
  • 12
2
votes
3 answers

UITextView the text is going out of the box

I am working on a chat app. The message box resizes according to the length of the text, but the text is going out of the box when the line breaks. I tried adding textView.contentInset = UIEdgeInsetsZero in textViewDidChange method, but it…
Lucas Paim
  • 417
  • 4
  • 13
2
votes
3 answers

How to set topMargin in percentage of superview in autolayout in storyboard?

How to set topMargin in percentage of superview in autolayout in storyboard? how does it works relative to second object when multiplier & constant changes of top margin constraint?
Minal Soni
  • 607
  • 8
  • 12
2
votes
0 answers

How can I change sizes and x/y coords of several UIViews with constraints in one method?

I have two UITableViews. Once the left one(for first level category) is clicked the right one(for second level) appears. A UIView with one UILabel and one UIButton appears when the secondary category is clicked. This UIView is shown in the first…
Yeongchan Jeon
  • 499
  • 3
  • 18
2
votes
2 answers

Constraints warning in console

I am new in Auto Layout and constraints. So I applied constraints according to super view by storyboard, but facing some below warning: "Unable to simultaneously satisfy constraints. Probably at least one of the constraints in the following…
Kishor Pahalwani
  • 1,010
  • 1
  • 23
  • 53
2
votes
0 answers

IOS viewwilltransitiontosize method call all viewcontroller when rotate

My application has Tabbar and Navigation options. My problem is, when device is rotating to landscape, previous viewcontroller viewwilltransitiontosize is also calling Let's explain the scenario, The first screen is AssignmentViewController …
Piraba
  • 6,974
  • 17
  • 85
  • 135
2
votes
1 answer

How do I stretch the view when tab is hidden

I'm using the auto layout via the storyboard. override func viewWillAppear(animated: Bool) { //hide bottom bar self.tabBarController?.tabBar.hidden = true } // postload func override func viewWillDisappear(animated: Bool) { …
Shawn Baek
  • 1,928
  • 3
  • 20
  • 34
2
votes
0 answers

AutoLayout for UICollectionView Header in iOS

I have created a UICollectionView header using viewForSupplementaryElementOfKind and i provided auto-layout constraints for UICollectionView using storyboard but that layout constraint is not working on CollectionView Header. So, my question is how…
shubham mishra
  • 971
  • 1
  • 13
  • 32
2
votes
2 answers

How to change UILabel width based on text length in iOS Using Auto-Layouts

I want to display two UILabel's, however UILabel's having variable text length's According to textsize UIlabel's width need to increase using auto-layouts. For this I wrote below auto-layouts for both UIlabel's First Label: 1)leading Space 2)Top…
Krish
  • 4,166
  • 11
  • 58
  • 110
2
votes
0 answers

Using Masonry to Layout 9 points

I'm using Masonay to layout UI like this: UI requirement The size of the 9 points are the same. And the margin between 9 points are the same. My question is that how to make margin to left of first column point equal to the margin to the right of…
MyEvonne
  • 21
  • 1
2
votes
1 answer

Xcode 7.3 Autolayout Issue

Ever since I switched to Xcode 7.3 my life has become a living hell as Xcode started showing autolayout constraint issues in my layouts which were working fine in Xcode 7.2 and even after searching a lot I couldn't find a solution. Here's the…
Sourav Chandra
  • 843
  • 12
  • 21
2
votes
0 answers

Today Widget - Conflict Autolayout Constraint When Locking the device

I am implementing a today widget. This is my first time getting hands onto the today widget. I created my today widget programmatically without using storyboard. Learned from this POST, What I did: 1. change the info plist 2. enable "Embedded…
2
votes
1 answer

Setting auto layout constraints programmatically on two views in ViewController

I am trying to add two UIView on ViewController. One of them is plain UIView and other is UITableView. I am not quite sure how to set height constraint on them in such away that UITableView will be of height required for its content and other view…
slonkar
  • 4,055
  • 8
  • 39
  • 63
2
votes
8 answers

Autolayout problems in bigger devices

I am developing an iPhone app in which, i have made this page using autolayout but it shows unwanted spaces above Register Me(yellow button) in bigger iPhones Constraints given are: top,bottom, leading and trailing with respect to its subviews to…
Krunal
  • 6,440
  • 21
  • 91
  • 155