Skip to main content

All Questions

Tagged with
0 votes
0 answers
46 views

UIView animation layoutIfNeeded causes top Constraint to break at the start of animation if not called on superview

I am able to demonstrate the issue with the below simple example code. I basically have a custom View (sort of like a nav bar) on which I animate the bar to hide/show the blue area (which will contain ...
sudoExclamationExclamation's user avatar
0 votes
2 answers
218 views

AutoLayout layoutIfNeeded bounds update time

I have the following code in my custom UIView. This gets called from init(frame:) or init(coder:) initializer: private func setupContentView() { contentView = ContentView(frame: .zero) ...
Deepak Sharma's user avatar
0 votes
1 answer
455 views

How to Constraint Two UI Elements to same place - Swift iOS

I'm attempting to constrain two ui elements to the same place. At the beginning of my program, I'm constraining a label to the center of a UiView. This is working fine. However later in my program, I'...
Shiv Nik's user avatar
  • 107
0 votes
1 answer
85 views

AutoLayout - space views apart a preferred distance and decrease down to a minimum distance before scrolling

Note: This is a follow-up question to this question: AutoLayout animate sliding view out and sliding other views over to take its place I am working on a view that arranges subviews horizontally ...
ashipma's user avatar
  • 475
0 votes
1 answer
276 views

AutoLayout animate sliding view out and sliding other views over to take its place

This is a follow-up question to this question. Following the solution proposed by @DonMag, where the horizontal centers of the views are constrained using AutoLayout, I have the following class and ...
ashipma's user avatar
  • 475
3 votes
1 answer
3k views

How to create a custom UIView with a subview inside, setting its size/position with AutoLayout programmatically?

I would like to create a custom UIView, say TestLabelView, which contains a label whose margin would be 16px. It would look like this: Here is how I tried to create this custom UIView and ...
Kelton's user avatar
  • 301
1 vote
1 answer
872 views

Swift Align Leading Edge with Trailing Edge

I have a label that I want as the x axis label on my graph, and I want to align the trailing edge of the label to the graph view, and also the top edge to the bottom edge of the graph view, how can I ...
aFella's user avatar
  • 205
0 votes
0 answers
84 views

Auto Layout issue with embed UIViewController inside UIView

My code works fine, and I've successfully embedded a UIViewController within UIView. The auto-layout from small to full screen and exiting full screen worked perfectly with just UIView, but when ...
Travgalax's user avatar
0 votes
0 answers
196 views

How to get views relative position on different device sizes

I have a UImageView which fits to almost entire device size (width/height) and it has a image which is aspect fit. One uiimageview is added on top of background UIImageView at some CGPoint. Now If we ...
user2029250's user avatar
0 votes
1 answer
949 views

inputAccessoryView, API error? _UIKBCompatInputView? UIViewNoIntrinsicMetric, simple code, can't figure out

Help me in one of the two ways maybe: How to solve the problem? or How to understand the error message? Project summary So I'm learning about inputAccessoryView by making a tiny project, which has ...
Goatt's user avatar
  • 121
0 votes
1 answer
326 views

IntrinsicContentSize on a custom UIView streches the content

I would like to create a custom UIView which uses/offers a IntrinsicContentSize, since its height depends on its content (just like a label where the height depends on the text). While I found a lot ...
Andrei Herford's user avatar
1 vote
2 answers
1k views

How to estimate preferred UIView size where one of the child views uses ratio constraint?

I've realised that I don't understand AutoLayout. I want to measure view's required height given the constant width. This is my TestViewTwo.xib TestViewTwo.swift import UIKit class TestViewTwo: ...
ievgen's user avatar
  • 1,101
0 votes
1 answer
439 views

Force UIView with zero height to lay out its subviews

I have an UIView with some labels in it. The labels have dynamic height depending on the text, and they have vertical spacing constraints to the parent view and to each other, giving the parent view ...
pajevic's user avatar
  • 4,657
1 vote
1 answer
861 views

Using custom UIView class with Auto Layout returns incorrect bounds

I'm presenting a simple view controller. To follow MVC, I moved my programmatic view code into a separate UIView subclass. I followed the advice here of how to set up the custom view. This works ok in ...
WayneYHuang's user avatar
0 votes
2 answers
571 views

Center of subview after device orientation

I have posted a similar question here UIView Position After Device Orientation I am designing an app with a single ViewController and a subview of the main view. This subview is a map. Initially the ...
ckc's user avatar
  • 373

15 30 50 per page
1
2 3 4 5
46