Skip to main content
Filter by
Sorted by
Tagged with
0 votes
1 answer
176 views

My swift code below is rotate a object at a 45 degree angle. My code below is having no effect on the rotation. I know I could rotate it i just create a frame but I need the constraints. I am not sure ...
user avatar
1 vote
0 answers
247 views

Something I find odd is once you create a constraint, the view hangs onto it forever, even if you explicitly remove it from the view's constraints collection (or set it's isActive to false which does ...
Mark A. Donohoe's user avatar
0 votes
1 answer
34 views

I can not figure out why my button is behaving different when using auto layout constraints programmatically. When setting the view that holds my cancelBtn every thing is working fine: let ...
Preefix's user avatar
  • 273
0 votes
0 answers
49 views

I gave a value of -8 to the "bottom to Safe Area bottom" constraints of 2 views, but they are not showing at the same distance from the Safe Area (seems like one needs -16 to equalize them). ...
user avatar
1 vote
1 answer
238 views

I am having trouble with my constraints. Any ideas would be appreciated!! I have tried making a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints using the debugger to catch it, but I didn'...
mick1996's user avatar
  • 616
0 votes
1 answer
68 views

in my project I have a someView(of type UIView), that inside holderView(of type UIView). someView have 2 state. in state 1 the someView become large and in the step 2 the someView become small. when ...
behrad's user avatar
  • 666
0 votes
0 answers
157 views

I'm adding a label programatically in my view, in viewDidAppear: var label : UILabel! override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) ........... label = ...
pablogupi's user avatar
  • 774
1 vote
1 answer
565 views

My swift code is trying to constraint a object to the bottom of the center y anchor. When the code is built and run on a iPad. That is not doing it. You can see the what is being displayed in the ...
user avatar
0 votes
3 answers
1k views

In my code below I am trying to constraint something to the top of the center point of the uiscreen. I have added a image of what I am looking for below. The code below is what I tried it pins it the ...
user avatar
0 votes
0 answers
345 views

I have a piece of code that is updating height constraint value. The code is running perfectly on my device but I have received tons of crash report from Crashlytics. I cannot reproduce the crash. ...
Season's user avatar
  • 1,218
0 votes
2 answers
3k views

In the didFinishLaunchingWithOptions of my app's AppDelegate, after initializing my UIWindow property, I set the root controller to a subclass of UITabBarController, in which I set the view ...
Que20's user avatar
  • 1,569
0 votes
2 answers
1k views

I do use multiplier with center constraints in the storyboard, now I want to do the same programmatically but can't figure out how to. No, this thread does not help since the accepted answer is a ...
itMaxence's user avatar
  • 1,405
0 votes
2 answers
2k views

I have a uitextview subview in an inputContainerView as it may appear in a messaging app. Programmatically, on load, the height anchor of the uitextview is set when the inputContainerView is ...
Chris's user avatar
  • 306
0 votes
1 answer
173 views

I am trying to add a button to a UIstackview, programmatically. All this is in fitxero XIB.   The button is created correctly, but when adding the constraints I get the following error: 2020-05-21 ...
Kargol's user avatar
  • 113
0 votes
1 answer
53 views

My swift code code below uses a slider to increase the size of the imageview. What I would like to do is when the slider moves from less than 0.5 the imageview gets smaller. If the value of the slider ...
user avatar
-1 votes
1 answer
59 views

I want to constraint my imageview to be spaced with a 20 percent gap from the leading anchor and 20 percent gap from the top anchor. You can see what I am looking for in the photo below. Somehow with ...
user avatar
0 votes
2 answers
50 views

My swift code as you can see in the gif below. Lets the user select one of the image views then use the slider to increase or decrease the size of that image view. The problem is when the image view ...
user avatar
-1 votes
1 answer
96 views

I'm programming a little app and I'm facing a problem that I don't know how to solve it. The problem is that for phones (like iPhone7) with a smaller width of the screen size the title appears ...
isaacmunoz's user avatar
0 votes
1 answer
155 views

As you can see in the gif below the light green objects moves south when the size of the dark green object is increased on the slide. What I want to do is when the dark green object size is increased ...
user avatar
0 votes
1 answer
227 views

I have created a custom keyboard and it works fine. I set the height constraint to be the same as the default keyboard. The issue is that when the keyboard first launches, it starts off below the ...
Mina Makar's user avatar
2 votes
1 answer
2k views

I have spent a while trying to figure this out, but I just can't. There is probably something really simple I am missing here. I am trying to animate a view coming in from the bottom. This si the code ...
Thijs van der Heijden's user avatar
0 votes
4 answers
2k views

This may be a simple question but I am struggling to find an answer that explains itself on the internet. What is the swift equivalent of setting an element's "position: fixed" from CSS? I am trying ...
mark32's user avatar
  • 113
0 votes
1 answer
513 views

My swift's code goal is to use a slider to increase decrease the size of a imageview. The imageview pic should be able to increase decrease size depending on what the value of slide slider is. When ...
user avatar
1 vote
1 answer
189 views

I'm setting constraints to image view programmatically like so: imgScrollView = UIScrollView(frame: CGRect(x: 0, y: 0, width: 100, height: 100)) imgScrollView....
user avatar
0 votes
1 answer
1k views

I'm stuck at the Consolidation IV challenge from hackingwithswift.com. Right now I'm trying to create a hangman game. I thought to place placeholder labels based on the length of the answer word. ...
Roman Zuchowski's user avatar
0 votes
1 answer
76 views

What I want to do is create a loop that allows pic and slide to have the same width and height constraints. Since I am constraining 0.25 to all constraints. I assume there is a way to do this without ...
user avatar
2 votes
1 answer
657 views

I'm trying to make a round button in the corner and when you press on it, 3 buttons pop up around it. Something like Pinterest's menu when you hold on a pin. I've looked up using UIBezierPath but it's ...
avmak's user avatar
  • 25
1 vote
1 answer
1k views

I'm trying to add a subview that would always have the same size as its parent, so that it would always resize if the parent size changes. I was thinking about adding (top, bottom, leading, trailing) ...
Xys's user avatar
  • 11.3k
0 votes
2 answers
2k views

I recently asked (and got a valid answer) to a question related to this issue. How do I get my UIViewRepresentable to correctly size for its content? As I mentioned in the previous post, I want to ...
Mozahler's user avatar
  • 5,363
1 vote
3 answers
2k views

I encountered the following problem. I was designing a custom UITableViewCell Design with Autolayout and everything worked perfectly. Xcode is not showing me any errors. But when I do run the app on ...
user avatar
0 votes
2 answers
7k views

I want to make the UIView's size: height = (width - 100) * 0.5, so the code like this: view.snp.makeConstraints { $0.top.left.right.equalTo(0) $0.height.equalTo(view.snp.width).offset(-100)....
JoShin's user avatar
  • 71
-2 votes
1 answer
121 views

hey developer I want to ask, I have a repeated create constraint and then I try to create a function that return NSLayoutConstraint. then I got confuse what should I return since there is 3 different ...
ferryawijayanto's user avatar
0 votes
2 answers
435 views

I'm working with some JSON that is giving me a series of views and subviews to lay out inside a UIView, and I'm wanting to use AutoLayout to achieve it. Here's an example of the JSON: "component": { ...
Luke's user avatar
  • 9,758
2 votes
2 answers
168 views

I have an outlet collection of labels. The labels are in stack views parented by a stack view. When the view loads I'd like to have each label fade in and move slightly to the right one after the ...
malaki1974's user avatar
  • 1,619
1 vote
2 answers
258 views

I have labels and an image. I want labels above image. And image without leading and trailing margin constraints. I have tried the following constraints but can't seem to get it right. And the row ...
swift dev's user avatar
0 votes
1 answer
78 views

I have problems with constraints in table view cell. As you can see in the image above , I tried to constrain the label on the far right so that label will be closer to the right right edge. But that ...
Learner456's user avatar
-1 votes
1 answer
56 views

Within a view controller, I have a UIView (backgroundCircle) and a UILabel. The UILabel is moving based on motionManager.startAccelerometerUpdates data. Using this data, I am animating the label....
nicksarno's user avatar
  • 4,285
0 votes
2 answers
222 views

I have a Nib file with a root UITableViewCell and child UILabel that I anchor at run time using programmatic constraints lblAccountItemTitle.translatesAutoresizingMaskIntoConstraints = false ...
Garren Fitzenreiter's user avatar
0 votes
1 answer
779 views

My swift code below is trying to get the uisiwtch to appear in the center of the screen. As you can see in my photo below. As You can see in the image below. The switch is taking up only a small part ...
user avatar
0 votes
1 answer
60 views

I have a custom UITextField that I use in multiple places, but am having a strange issue with it's constraints on only a few of the pages I use it. The custom class has a few things I add upon ...
BlondeSwan's user avatar
0 votes
1 answer
91 views

My swift code below is positioning objects. I want both objects to be to cover 10 percent of the x axis each. So the first object which is fight[0].image and the 2nd object is fight1.image. As you can ...
user avatar
5 votes
4 answers
3k views

My VC starts with stackView attached with Align Bottom to Safe Area . I have tabBar, but in the beginning is hidden tabBar.isHidden = true. Later when the tabBar appears, it hides the stackView So ...
Bogdan Bogdanov's user avatar
0 votes
1 answer
615 views

I'm slowly going insane trying to debug an Unable to satisfy constraints warning in the console, which appears when I transition from iPhone portrait to iPhone landscape. I'm working on a Dashboard-...
Tom's user avatar
  • 543
0 votes
1 answer
473 views

I have a custom UIAlert where I set the content view controller to my own custom VC. The alert functions properly, but I keep getting this error: "A constraint factory method was passed a nil layout ...
Jeff Small's user avatar
-1 votes
2 answers
2k views

I have a constraint scenario which works perfectly when built through interface builder but I cannot make it through code. The screen layout is the following: A Horizontal UIStackView with multiple ...
GGirotto's user avatar
  • 1,135
-1 votes
3 answers
161 views

My swift code below has a image view connected to a pangesture. When something is entered into a textfield when after the image view is moved. The image view reverts back to its original position.The ...
user avatar
0 votes
1 answer
326 views

A view's height in my view controller needs to change as the user interacts with the application. Sometimes the view needs to be larger in height and other times it needs to be shorter depending on ...
Michael Jajou's user avatar
0 votes
1 answer
103 views

I am trying to create UIButton inside the UITableViewCell using following way UITableView configuration : self.tableView.estimatedRowHeight = 1 self.tableView.rowHeight = UITableView....
Sabish.M's user avatar
  • 2,050
3 votes
1 answer
230 views

I am creating a popup menu. It has a UIPresentationController that calculates frameOfPresentedViewInContainerView based on presented view controller's view size before showing it. Presented view ...
Vladimir's user avatar
  • 395
0 votes
1 answer
49 views

My swift code below is using nslayout constraints in view did load. I have tried to place a uipangestureRecognizer on a imageview. To get the image view to move around the uiview controller. Right now ...
user avatar

1 2 3
4
5
43