Questions tagged [uilayoutguide]

16 questions
13
votes
2 answers

Constraints to center and object between two objects

My design requires that a button is centered between two other objects. One of the objects is in the vertical center of the view (green). The other object is some distance from the bottom edge (green). Now the task is to center the third object…
Joe Andolina
  • 648
  • 1
  • 11
  • 23
3
votes
1 answer

How to manage focus when you use container ViewControllers

How to manage FocusGuide in tvOS when you have container view/views? I'm using a MasterViewController and have more than one container view controllers and it all together act like UITabBarController. But when I navigate between buttons it's not…
MGY
  • 7,245
  • 5
  • 41
  • 74
3
votes
0 answers

UITableViewIndex Tableview section index doesn't fall under safearea automatically for iPhoneX

As the contentView of UITableView comes safe area,but the default UITableViewIndex(A.B..Z) at the right of table doesn't comes under safe area and getting clipped by iPhone X landscape but the native Contacts App works perfect.
3
votes
1 answer

topLayoutGuide equivalent in UIPresentationController?

I have a custom transition for presenting a view controller and I use a UIPresentationController subclass to perform the presentation. In the presentation controller I add a couple of subviews to its containerView (the chrome). I would like to…
Mischa
  • 15,816
  • 8
  • 59
  • 117
3
votes
0 answers

Is is possible to position an element offscreen using Visual Format Language?

I get an error when I try this: let space = UILayoutGuide() view.addLayoutGuide(space) let myFormatString = "someLabel|space-anotherLabel-|" Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Unable to parse…
7stud
  • 46,922
  • 14
  • 101
  • 127
2
votes
1 answer

iOS - UIView above UITabBar with Layout Guide

I have a UIView above my UITabBar that will be able to show and disappear. The View is added as a SubView in the UITabBarController's View. I want to change the Bottom Layout Guide depending on the View's state. Example: When the View is hidden, the…
evenwerk
  • 947
  • 1
  • 12
  • 28
1
vote
1 answer

iOS 10, swift 4.1, setting view's top anchor to topLayoutGuide bottom anchor causing conflicts

I am trying to set my view's position to be under the status bar. It works with the safeAreaLayoutGuide in iOS 11+ but I'm trying to use a suggestion I found online for < 11. Here is what I'm trying. if #available(iOS 11.0, *) { let guide =…
1
vote
1 answer

EXC_BREAKPOINT on different versions of iOS

My app keeps crashing in 2 different places in any version that is lower than iOS 11. One of the crashes is an EXC_BREAKPOINT that breaks on the appDelegate class defining line - class AppDelegate: UIResponder, UIApplicationDelegate {} While the…
1
vote
1 answer

Set vertical position for UILabel in UICollectionViewCell using UILayoutGuide

I'm completely new to UILayoutGuide. I'd like to position a UILabel in the middle of the white space below the imageView, which is the superview of both imageView and UILabel (see view hierarchy below). Normally, I would add another view and set…
theDC
  • 6,364
  • 10
  • 56
  • 98
0
votes
0 answers

UIKit Layout constraints react to keyboardLayoutGuide

I want to ensure that when the keyboard is not visible, the input is anchored to the upper part of the tabBar. When the keyboard is visible, I want it to be layered above the tabBar, and the input should be attached to the view's…
Leo
  • 48
  • 5
0
votes
1 answer

Layout guide has conflicts with auto layout constraints

I entered an example in a book for iOS programming, but the example doesn't work. The result of the examples is supposed to be like the following picture: The code of the example is like the following: import UIKit class ViewsController:…
Michael May
  • 286
  • 2
  • 11
0
votes
1 answer

space position objects by proportion

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 see on the image on the left is what the current…
user12655184
0
votes
1 answer

Constrain UIView's proportionally

I want to position my view's in relative terms. I want do use percentages and not pixels. Say I want to position a button's center at 25% of its super view's height. How would I do this? One way to do it would be: button.topAnchor.constraint( …
Alex Bollbach
  • 4,370
  • 9
  • 32
  • 80
0
votes
1 answer

Why is the topLayoutGuide length different on iPhone and iPad?

On an iPad, my view controller (inside a navigation controller, as the detail view of a split view controller) has a topLayoutGuide length of 64 with the navigation bar shown and 20 with the navigation bar hidden. This makes sense. On an iPhone in…
0
votes
0 answers

Trying to determine if IOS StatusBar is displayed in landscape

I am trying to determine if the StatusBar is being displayed when my iDevice is in landscape. I have overridden viewWillTransitionToSize so that I can recalculate the view layout, but cannot find any property to show StatusBar…
IanH
  • 1
  • 1
1
2