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
2 answers

Dynamic UITableView cell height with UIStackViews

I am trying to create a dynamic height row using UIStackViews and autolayout, so below is my UITableViewCell xib. So as you can see it has all the stackViews inside it. I tried using estimated row height and the delegate functions. But nothing…
Ranjit
  • 4,576
  • 11
  • 62
  • 121
2
votes
1 answer

How to fix AutoLayout for my ScrollView?

I have a view controller that has a UIView(ParentView) and then UIScrollview(ScrollView). The ParentView is anchored to the leading, trailing, top and bottom of the ViewController. The ScrollView is anchored to the leading, trailing, top and bottom…
user1019042
  • 2,428
  • 9
  • 43
  • 85
2
votes
3 answers

iOS Scroll View doesn't scroll with auto layout with views added in programmatically

I have a ViewController with a scrollView and a content View inside. Some labels and stuff inside the Content View as well. Now after that, when the view load i have to pass in data from other places to this view controller, and then load some…
2
votes
2 answers

Best way to programmatically layout UILabel and UIView subviews in UITableViewCell in Swift

Using Swift and autolayout, what's the best way to put a label and custom view in a cell? I want the label on the left and the view on the right. The view could be any subclass of UIView. One problem I'm having is sizing the label's width to fit…
user3246173
  • 488
  • 6
  • 18
2
votes
2 answers

How to change the image position according to the orientation in ios?

In portrait I am having two images in the corners one is on the left top and the another on the bottom right.When I rotate the two images stays in the same corner.But I need the whole portrait screen to be rotate left by 90 degree. Here is the…
2
votes
1 answer

label is disappear with auto layout if it does not have any string

I am very new in IOS development. I'm having trouble in auto layout, I have a label and "hello" string in it and I'm deleting characters using button click from string. If i don't use auto layout label is not being disappear(while it does not…
Jeni Khant
  • 350
  • 3
  • 13
2
votes
1 answer

Align edge of element to center of superview in xCode/swift

I found another stackoverflow post asking about essentially the exact same thing I am trying to solve (iOS Autolayout how to stretch 2 button horizontally), however I am still having issues figuring out how to go about aligning the edge of my object…
Randy Banks
  • 371
  • 1
  • 7
  • 25
2
votes
1 answer

How to make my button center in navigation drawer and also remove the edge shadow using swift?

I need to create a navigation drawer. I am using swift and iOS 8. For creating navigation drawer I am using MMDrawerConroller library It is working great. But I am facing some problems. In left drawer I put the button and as well as label both…
2
votes
1 answer

Centering a UIView programmatically using Autolayout makes the view disappear from superview

I have the following code to simply center a red square using AutoLayout constraints programmatically in my ViewController's view: class ViewController: UIViewController { let square: UIView required init?(coder aDecoder: NSCoder) { …
nburk
  • 22,409
  • 18
  • 87
  • 132
2
votes
1 answer

iOS 9 Auto Layout Alignment Rect Issues

So I have a solid understanding of the differences between the frame and alignment rect on UIView. However, in practice the concept doesn't seem to work. I override alignmentRectInsets which will inset the frame according to the content that I want…
JamWils
  • 785
  • 7
  • 17
2
votes
4 answers

Static Spacing on AutoLayout

I'm currently setting up a login screen that should ultimately look something like this: I've successfully accomplished all the constraints needed to create the desired look on all screen sizes, however, I can not seem to figure out the constraint…
Aaron
  • 757
  • 5
  • 18
2
votes
1 answer

How to get iOS tableview last right content size with use auto layout

I have a tableview UITableViewAutomaticDimension for auto layout, and I get the tableview content size to make the tableview height as it content height after tableview cell configure and reload, this height isn't right it seems calculate by…
Wayn Liu
  • 394
  • 3
  • 13
2
votes
1 answer

how to get actual size of custom view which is loaded from nib ios

I am loading a custom view from xib and adding it in my main view. I need to get the actual size of that view once it is loaded and added in the main view. I am using autolayout for that custom view to place their sub views. Problem is it is…
Dhaval H. Nena
  • 3,992
  • 1
  • 37
  • 50
2
votes
0 answers

Change (Arabic) language within the application

I am creating an application where i have used english and arabic language. I have created this application with autolayout. The tricky part i am facing is that user can change the language settings from the application as well. Autolayout is…
user1115985
  • 39
  • 10
2
votes
0 answers

Is it possible to overlap views with AutoLayout

Say you had a screen that had 2 full size views in it (edge to edge, top to bottom, left to right) and the topmost view in the z-order had an alpha that made it partially transparent so that you could see the other view underneath it. Is there a way…
Logicsaurus Rex
  • 3,172
  • 2
  • 18
  • 27