Auto Layout

RSS for tag

Create a user interface that dynamically responds to changes in the available screen space using Auto Layout.

Posts under Auto Layout tag

117 Posts

Post

Replies

Boosts

Views

Activity

How do I arrange the stack view to show the profile image next to the username?
So I have a stack view and the profile image needs to go next to the the username and stay there. How do I do that in this arranged stack view without conflicts because I have tried to anchor it to the top. Like this but no results: But I am actually getting: Here is the code for the stack view:     override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {         super.init(style: style, reuseIdentifier: reuseIdentifier)         contentView.addSubview(profileImageView)         contentView.addSubview(profileNameLabel)         contentView.addSubview(userHandel)                                    profileImageView.setContentHuggingPriority(.defaultHigh, for: .horizontal)                                                               let innerPostStackView = UIStackView(arrangedSubviews: [profileNameLabel, userHandel, postTextLabel])         innerPostStackView.axis = .vertical                       let postStackView = UIStackView(arrangedSubviews: [profileImageView, innerPostStackView])         postStackView.translatesAutoresizingMaskIntoConstraints =  false         postStackView.alignment =  .center         postStackView.spacing = 10         contentView.addSubview(postStackView)                           NSLayoutConstraint.activate([                          postStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 10),             postStackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -15),             postStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10),             postTextLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -15)                                         ]) Hope someone can help.
3
0
2.9k
Nov ’22
Move up a scroll view.
i have the next problem, i have a scroll view that contains an stack view in the center of my app, but in the botton of the view i have some checkbox, sometimes the user got 1, sometimes the user got 3. how i can move the scroll view to the top when the 3 checkbox are enable. to explain this in a graphic way and in a more common problem. Imagine that the checkbox are the keyboard, they go up (because it take more space when 3 checkbox are enabled) and i need to move the content of my app and maintain the content always in the visible rect of the scroll view. I cant use a simple view since the icons inside my scroll view had to have always the same size. all my constraints are made in a xib file. i dont want the full solution just ideas of what i can do or how i can face this problem. this is what i want , left image are devices like pro max series and right image the smaller ones, like SE 1st gent. Thanks
0
1
867
Nov ’22
Weird behaviour of a NSLayoutConstraint used with Size Class variation when app going background
Hello I set a few constraints on a UIView in the storyboard. The height constraint is set to 300 and has a size class variation set on 350 (see screenshot). In my code, I modify the constraint and set its constant to 100. When I call that code, I see the view changing correctly its height to 100. But If I go to homescreen ( app in background) and come back to the app, the height of the view is set back to the old value (300). This problem only appears when the constraint has a size variation. When I remove the variation on the height, the behaviour is ok, the height stays at 100 when I go to homeview and switch back to the app. Is that a bug of AutoLayout ? Is there a workaround ? (tested with iOS16, on iPhone Xr and iPhone 14 Pro, xcode 14) class ViewController: UIViewController {     @IBOutlet weak var heightConstraint: NSLayoutConstraint!     override func viewDidLoad() {         super.viewDidLoad()     }     @IBAction func buttonPushed(_ sender: Any) {         heightConstraint.constant = 100; // works ok until app goes background     } }
3
1
2.8k
Nov ’22
SwiftUI List views size bug (iOS 16)
Hello everyone. I just discovered one issue with List in iOS16. The sample Playground code is provided below. Steps to reproduce: Run the code. Scroll down the list to the bottom so first rows become hidden. Scroll up to first row. Tap on first row. Result: row is marked as selected but its size stays unchanged. Once you scroll the list up and down this row will resize itself. Expected result: row resize immediately after tap on it. Note that if you don't perform steps 2 and 3 (maybe cells are not being reused) it works as expected. Also on iOS 14, 15 it works as expected import PlaygroundSupport struct Item: Identifiable, Equatable {     let id: String     let name: String } struct App: View {          @State var items: [Item] =   [Item(id: "0", name: "Apples"),                                   Item(id: "1", name: "Oranges"),                                   Item(id: "2", name: "Bananas"),                                   Item(id: "3", name: "Pears"),                                   Item(id: "4", name: "Mangos"),                                   Item(id: "5", name: "Grapefruit"),                                   Item(id: "6", name: "Peaches"),                                   Item(id: "7", name: "Qiwies"),                                   Item(id: "8", name: "Strawberries"),                                   Item(id: "9", name: "Lemons"),                                   Item(id: "10", name: "Limes"),                                   Item(id: "11", name: "Pineapples")]     @State var selections: [Item] = []         var body: some View {         List(items) { item in             MultipleSelectionRow(title: item.name, isSelected: selections.contains(item)) {                 if selections.contains(item) {                     selections.removeAll(where: { $0 == item })                 }                 else {                     selections.append(item)                 }             }         }     } } struct MultipleSelectionRow: View {     var title: String     var isSelected: Bool     var action: () -> Void          var body: some View {         HStack {             Text(title)             if isSelected {                 Spacer()                 Image(systemName: "checkmark")             }         }         .frame(height: isSelected ? 120 : 60)         .onTapGesture {             action()         }     } } PlaygroundPage.current.setLiveView(App().previewDevice("iPhone 13"))
1
0
2k
Nov ’22
How to have different layouts for iPhone and iPad
first, I am using a translator. Please understand. want to add buttons using Auto Layout on a large image. Auto layout applied but button position incorrectly //let screenHeight = UIScreen.main.bounds.size.height Currently, the height was obtained through the above method and automatic layout was applied to each. However, too many situations had to be considered when trying to apply the iPad. Isn't there a better way?
0
0
749
Oct ’22
Warnings in NSCollectionView referencing UICollectionViewFlowLayout
Hi, I have an NSOutlineView, and each cell within that has an NSCollectionView (a horizontal one), setup using autolayout with the 'height' of the collectionView driving the height of the OutlineView cell. Each item in the collectionView can have a dynamic width, and I use a 'dummy' collectionView to size each item from it's contents, then getting the height of the collectionView and using a 'height constraint' to make each collectionView get the height it needs (and hence the cell have a dynamic height. It works fine for the most part, but I get this warning multiple times in the console: "The behavior of the UICollectionViewFlowLayout is not defined because: the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values. The relevant UICollectionViewFlowLayout instance is <NSCollectionViewFlowLayout: 0x10e3b7f80>, and it is attached to <MacTagsCustomCollectionView: 0x10e3b7840>. Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger." I've tried Googling this, but I can't find a good explanation for this issue. Also, I'm not sure why it references 'UICollectionViewFlowLayout' when it's an AppKit app and uses NSCollectionView. Also, setting the 'UICollectionViewFlowLayoutBreakForInvalidSizes' symbolic breakpoint doesn't help since it never gets triggered. Here is some code from my outlineView's viewForTableColumn, where I get the height of the collectionView and hence the height of the cell: result = [outlineView makeViewWithIdentifier:@"DataWithTags" owner:self]; if (result.tagListCollectionView.delegate == nil) { result.tagListCollectionView.delegate = self; result.tagListCollectionView.dataSource = self; result.tagsCollectionViewScrollView.automaticallyAdjustsContentInsets = NO; result.tagListCollectionView NSNib *cellNib = [[NSNib alloc] initWithNibNamed:@"MacTagsForPersonItem" bundle:nil]; [result.tagListCollectionView registerNib: cellNib forItemWithIdentifier:@"PersonTagsCollectionViewItemID"]; if (self.tagsSizingItem == nil) { NSArray *topLevelObjects; [cellNib instantiateWithOwner:self.tagsSizingItem topLevelObjects: &topLevelObjects]; for (id topLevelObject in topLevelObjects) { if ([topLevelObject isKindOfClass:[MacPersonTagsCollectionViewItem class]]) { self.tagsSizingItem = topLevelObject; break; } } } result.tagListCollectionView.backgroundColors = @[[NSColor clearColor]]; result.tagListCollectionView.enclosingScrollView.backgroundColor = [NSColor clearColor]; result.tagsCollectionViewScrollView.verticalScroller.hidden = YES; } result.tagListCollectionView.tagsPerson = person; [result.tagListCollectionView reloadData]; result.frame = outlineView.bounds; [result layoutSubtreeIfNeeded]; [result.tagListCollectionView layoutSubtreeIfNeeded]; if (person.tagsCacheHeight == 0) { &#9; person.tagsCacheHeight = result.tagListCollectionView.collectionViewLayout.collectionViewContentSize.height; } result.collectionViewHeightConstraint.constant = person.tagsCacheHeight; Anyone with any idea on how to overcome this? I feel that it's responsible for some layout issues that I'm having in the view.
2
0
2.9k
Oct ’22
How to resize items in collection view to perfectly fit bigger screen sizes?
I have a collection view with vertical flow layout. On bigger iPhones there is empty space after the 5 items in the row. Height and width and fixed at 30. There is empty space horizontally after the 5th item in the row. If i turn height and width constraint to be 'greater that of equal to' then i see just 3 items in the row and the remaining 2 appear in the row below. I find constraints very challenging and want guidance with setting them right so that the items resize on all screens to have exactly 5 items in a row from edge to edge of the collection view.
2
0
1.6k
Oct ’22
UICollectionView - Compositional Layout rotation problem with full screen cells
Hello guys! I'm having this weird issue with a basic compositional layout (full screen cell with horizotal swiping), on a collection view: whenever I rotate the device, it's showing the wrong cell. I think this is a problem of the content offset, because it's always jumping to the previous image (2nd to 1st, 3rd to 2nd, etc.), and this is even before the rotation started (I tried setting the cell manually in viewWillTransition, but it also jumps). And when i come back to portrait, it returns to the "original" image. Here is a gif with the slow animation: https://gifyu.com/image/S3M3d. Note that on the video the cell is changing from 2nd to 1st, but if I'm on the 3rd cell, it changes to the 2nd one. So it seems it's always to the previous one. This is the layout definition: let itemSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1) ) let layoutItem = NSCollectionLayoutItem(layoutSize: itemSize) layoutItem.contentInsets = .zero layoutItem.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .none , top: .none, trailing: .none, bottom: .none) let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1)) let layoutGroup = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [layoutItem]) layoutGroup.interItemSpacing = .fixed(0) let layoutSection = NSCollectionLayoutSection(group: layoutGroup) layoutSection.interGroupSpacing = 0 layoutSection.orthogonalScrollingBehavior = .groupPaging let collectionViewLayout = UICollectionViewCompositionalLayout(section: layoutSection) let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout) collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.backgroundColor = .clear collectionView.bounces = false collectionView.isPagingEnabled = true collectionView.showsHorizontalScrollIndicator = false collectionView.delegate = self collectionView.dataSource = self collectionView.register(CustomCell.self, forCellWithReuseIdentifier: "...") I've tried everything (removed every spacing, inset, and all that I could find), but I can't make it work. Any ideas? It's been driving me crazy. Thanks in advance.
0
1
1.5k
Sep ’22
UICollectionViewRecursion when using estimated sizes in Compositional Layout
Hi everyone, our team was transferred a project that is using a "UICollectionViewCompositionalLayout" for displaying a large amount of data. On iOS 14 and below, we seemed to be having no problems. Now on iOS 15 however, we keep getting this debugger message: APPNAME[47924:507017] [UICollectionViewRecursion] cv == 0x7ff2af9d0200 Disabling recursion trigger logging We are also collecting crashes in our crash tool, solely from iOS 15 devices, saying: NSInternalInconsistencyException: UICollectionView (<UICollectionView 0x1122a6400>) is stuck in its update/layout loop. This can happen for many reasons, including self-sizing views whose preferred attributes are not returning a consistent size. To debug this issue, check the Console app for logs in the "UICollectionViewRecursion" category. We've found that setting all .estimated() sizes we're using in the section provider to .absolute() gets rid of the message, but of course the views aren't sized correctly then. We are using views that size themselves based on the content they display, using UIStackViews. We need them to be dynamic in height. Has something changed moving from iOS 14 to 15 about how the compositional layout has to be configured? Is there something we can do to further debug this issue? I've found some questions about this asked on StackOverflow, but none of them were answered either.
8
2
7.4k
Sep ’22
Crashlytics : iOS Crash : CoreAutoLayout _col_rawAddForEngineVar
CoreAuto layout crash issue I absolutely do not have any idea, what can occure this problem and how can i reproduce. It crashes randomly. I use Crashlytics v3.14 in my project. Does anybody face with the same problem? Crashlytics : iOS Crash : CoreAutoLayout _col_rawAddForEngineVar Crash Item : _col_rawAddForEngineVar Issue Details : Crashed: com.apple.main-thread 0 CoreAutoLayout 0xbb20 _col_rawAddForEngineVar + 180 1 CoreAutoLayout 0x5990 _engineVar_addForVariableIfNeeded + 464 2 CoreAutoLayout 0x152f0 -[NSISLinearExpression setCoefficient:forVariable:] + 56 3 CoreAutoLayout 0xc9e8 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 188 4 CoreAutoLayout 0xef4c -[NSLayoutConstraint _addToEngine:mutuallyExclusiveConstraints:] + 140 5 UIKitCore 0x1df1ec __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 372 6 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 7 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 8 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 9 UIKitCore 0x1df134 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 188 10 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 11 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 12 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 13 UIKitCore 0x1df134 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 188 14 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 15 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 16 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 17 UIKitCore 0x4845c0 -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 212 18 UIKitCore 0x1ecdd8 -[UIView _layoutEngine_windowDidChange] + 124 19 UIKitCore 0x2b6de0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 280 20 UIKitCore 0x2b706c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 932 21 UIKitCore 0x1dd82c __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 140 22 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 23 UIKitCore 0x26d060 -[UIView(Hierarchy) _postMovedFromSuperview:] + 840 24 UIKitCore 0x189b90 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2152 25 UIKitCore 0x3b0638 -[UITableView _addSubview:positioned:relativeTo:] + 108 26 UIKitCore 0x178554 -[UIScrollView _addContentSubview:atBack:] + 380 27 UIKitCore 0x19e01c -[UITableView _addContentSubview:atBack:] + 252 28 UIKitCore 0x19a754 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 1772 29 UIKitCore 0x1729a8 +[UIView(Animation) performWithoutAnimation:] + 104 30 UIKitCore 0x419dbc -[UITableView _configureCellForDisplay:forIndexPath:] + 272 31 UIKitCore 0x286ac4 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1788 32 UIKitCore 0x484030 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 732 33 UIKitCore 0x2abbbc -[UITableView _updateVisibleCellsNow:] + 1432 34 UIKitCore 0x17bed8 -[UITableView layoutSubviews] + 456 35 UIKitCore 0x18c17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592 36 QuartzCore 0x407fc CA::Layer::layout_if_needed(CA::Transaction*) + 532 37 QuartzCore 0x32c60 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136 38 QuartzCore 0x475b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452 39 QuartzCore 0x504a8 CA::Transaction::commit() + 704 40 QuartzCore 0x323a0 CA::Transaction::flush_as_runloop_observer(bool) + 88 41 CoreFoundation 0x410c4 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 36 42 CoreFoundation 0x10080 __CFRunLoopDoObservers + 592 43 CoreFoundation 0xb13c __CFRunLoopRun + 1052 44 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600 45 GraphicsServices 0x1374 GSEventRunModal + 164 46 UIKitCore 0x514b58 -[UIApplication _run] + 1100 47 UIKitCore 0x296090 UIApplicationMain + 364 48 TCP App 0xbad894 main + 39 (AppDelegate.swift:39) 49 ??? 0x10674dda4 (Missing)
0
0
1.1k
Sep ’22
How to programmatically access font style on UILabel?
Hi, In an iOS app, I have a Storyboard View Controller with a UILabel on it where I set the font style to Body/Heading/whatever with dynamic fonts. This all works fine. However, is there a way in the VC code to extract that font style? I've looked at the associated font and font descriptor for the UILabel but don't see an obvious attribute for it. Any idea how to see it? I would prefer not to hardcode it and extract it from the UILabel instead. I need it as I will be modifying portions of the text (bold, etc.). Regards, Patrick
0
0
1.3k
Aug ’22
Why are my equally-constrained UIViews not rendered with the same size?
Howdy! I have a view which is constrained to a height of 0.5 and is reused in several places. When several are rendered near each other however, it becomes clear that their heights are subtly different (but enough to annoy me!). It doesn't appear as if any constraints are breaking. For additional information, I am trying to roughly replecate the appearance of the UITableView seperator in some of my views. Hints on how UIKit manages to ensure that a UITableView's seperators all appear to be the same height will also be appreciated. Thanks, smkuehnhold
6
0
1.4k
Aug ’22
Need help with autolayout solution
Views A and B are equal in width (set up via a constraint). The actual width will vary at runtime. What I want to do is arrange view A such that it is horizontally centered on B but offset to the left by 1/10th of the total width. In other words, if views A and B were 100 units in length, I'd want A to be positioned 10 units to the left of B. If the width were 150 units then the A position would be 15 to the left, etc. I thought I could do this with either a leading constraint or a centerX constraint using a multiplier of 0.9, but it isn't working out the way I want. What's the best solution?
1
0
699
Jul ’22
Memory Crash on layoutIfNeeded()
Can anyone help me diagnose this crash. It happens in the animation block on the layoutIfNeeded() function call. Full function and. crash report attached.     private func showWarningView() {         DispatchQueue.main.async { [weak self] in             guard let strongSelf = self else { return }             if let safeAreaHeight = strongSelf.superview?.safeAreaLayoutGuide.layoutFrame.size.height {                 let visibleBannerHeight: CGFloat = strongSelf.isBannerVisible ? strongSelf.bannerHeight : 0                 let newConstraintConstant = (safeAreaHeight - strongSelf.externalBottomOffset - visibleBannerHeight) - strongSelf.warningBannerHeight                 strongSelf.addInternalBottomOffset(with: strongSelf.warningBannerHeight)                 strongSelf.warningViewTopConstraint.constant = newConstraintConstant             }             strongSelf.isWarningViewVisible = true             let showWarningView = UIViewPropertyAnimator(duration: 0.25, curve: .easeIn, animations: {                 self?.layoutIfNeeded()             })             showWarningView.startAnimation()         }     } Crash Report
0
1
1.7k
Jun ’22
Label wrapping issue - iOS 16 beta
Hello, does anyone experience this issue on the iOS 16 beta? The text wrapping in a simple label seems it is different in the iOS 16 beta. As you can see in the image attached, the "essentially" text goes to the line below in the iOS 16 beta, this is just a dummy example but we have seen a lot of screens where this wrapping happens. For the record: it is the same label with the same leading and trailing constraints values, the only thing that has changed is the IOS version. As our app needs to be "Pixel-perfect" this is a problem because we have a lot of screens to fix and we want to avoid adding iOS version logic in the code.
2
0
1.9k
Jun ’22
CoreAutoLayout -[NSISEngine withAutomaticOptimizationDisabled:]
Xcode version: 13.2.1 (13C100) plateform: iOS Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x99288 __exceptionPreprocess 1 libobjc.A.dylib 0x16744 objc_exception_throw 2 CoreAutoLayout 0x57ac -[NSISEngine withAutomaticOptimizationDisabled:] 3 CoreAutoLayout 0xaa6c -[NSISEngine _optimizeWithoutRebuilding] 4 CoreAutoLayout 0xcb78 -[NSISEngine optimize] 5 CoreAutoLayout 0x50fc -[NSISEngine performPendingChangeNotifications] 6 UIKitCore 0x350710 -[UIView(Hierarchy) layoutSubviews] 7 UIKitCore 0x18bfb4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 8 QuartzCore 0x40cd0 CA::Layer::layout_if_needed(CA::Transaction*) 9 QuartzCore 0x33134 CA::Layer::layout_and_display_if_needed(CA::Transaction*) 10 QuartzCore 0x47a7c CA::Context::commit_transaction(CA::Transaction*, double, double*) 11 QuartzCore 0x50970 CA::Transaction::commit() 12 QuartzCore 0xa89a8 CA::Transaction::release_thread(void*) 13 libsystem_pthread.dylib 0x1e58 _pthread_tsd_cleanup 14 libsystem_pthread.dylib 0x48d0 _pthread_exit 15 libsystem_pthread.dylib 0x13b8 pthread_main_np 16 libsystem_pthread.dylib 0x1144 _pthread_wqthread 17 libsystem_pthread.dylib 0xe5c start_wqthread
0
0
1.2k
Jun ’22
untime: Layout Issues: Position and height are ambiguous for UIInputSetContainerView.
User case : I am using swiftui with UIHostingController on my app. My entire view is messed up when the keyboard is presented for a text field. This problem happens if - Keyboard is presented in another controller with UIKit text field and then came to this (SwiftUI) screen and the Keyboard is presented for the swiftUI textfield.
0
0
711
May ’22
How do I arrange the stack view to show the profile image next to the username?
So I have a stack view and the profile image needs to go next to the the username and stay there. How do I do that in this arranged stack view without conflicts because I have tried to anchor it to the top. Like this but no results: But I am actually getting: Here is the code for the stack view:     override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {         super.init(style: style, reuseIdentifier: reuseIdentifier)         contentView.addSubview(profileImageView)         contentView.addSubview(profileNameLabel)         contentView.addSubview(userHandel)                                    profileImageView.setContentHuggingPriority(.defaultHigh, for: .horizontal)                                                               let innerPostStackView = UIStackView(arrangedSubviews: [profileNameLabel, userHandel, postTextLabel])         innerPostStackView.axis = .vertical                       let postStackView = UIStackView(arrangedSubviews: [profileImageView, innerPostStackView])         postStackView.translatesAutoresizingMaskIntoConstraints =  false         postStackView.alignment =  .center         postStackView.spacing = 10         contentView.addSubview(postStackView)                           NSLayoutConstraint.activate([                          postStackView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor, constant: 10),             postStackView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor, constant: -15),             postStackView.topAnchor.constraint(equalTo: contentView.topAnchor, constant: 10),             postTextLabel.bottomAnchor.constraint(equalTo: contentView.bottomAnchor, constant: -15)                                         ]) Hope someone can help.
Replies
3
Boosts
0
Views
2.9k
Activity
Nov ’22
Move up a scroll view.
i have the next problem, i have a scroll view that contains an stack view in the center of my app, but in the botton of the view i have some checkbox, sometimes the user got 1, sometimes the user got 3. how i can move the scroll view to the top when the 3 checkbox are enable. to explain this in a graphic way and in a more common problem. Imagine that the checkbox are the keyboard, they go up (because it take more space when 3 checkbox are enabled) and i need to move the content of my app and maintain the content always in the visible rect of the scroll view. I cant use a simple view since the icons inside my scroll view had to have always the same size. all my constraints are made in a xib file. i dont want the full solution just ideas of what i can do or how i can face this problem. this is what i want , left image are devices like pro max series and right image the smaller ones, like SE 1st gent. Thanks
Replies
0
Boosts
1
Views
867
Activity
Nov ’22
Weird behaviour of a NSLayoutConstraint used with Size Class variation when app going background
Hello I set a few constraints on a UIView in the storyboard. The height constraint is set to 300 and has a size class variation set on 350 (see screenshot). In my code, I modify the constraint and set its constant to 100. When I call that code, I see the view changing correctly its height to 100. But If I go to homescreen ( app in background) and come back to the app, the height of the view is set back to the old value (300). This problem only appears when the constraint has a size variation. When I remove the variation on the height, the behaviour is ok, the height stays at 100 when I go to homeview and switch back to the app. Is that a bug of AutoLayout ? Is there a workaround ? (tested with iOS16, on iPhone Xr and iPhone 14 Pro, xcode 14) class ViewController: UIViewController {     @IBOutlet weak var heightConstraint: NSLayoutConstraint!     override func viewDidLoad() {         super.viewDidLoad()     }     @IBAction func buttonPushed(_ sender: Any) {         heightConstraint.constant = 100; // works ok until app goes background     } }
Replies
3
Boosts
1
Views
2.8k
Activity
Nov ’22
SwiftUI List views size bug (iOS 16)
Hello everyone. I just discovered one issue with List in iOS16. The sample Playground code is provided below. Steps to reproduce: Run the code. Scroll down the list to the bottom so first rows become hidden. Scroll up to first row. Tap on first row. Result: row is marked as selected but its size stays unchanged. Once you scroll the list up and down this row will resize itself. Expected result: row resize immediately after tap on it. Note that if you don't perform steps 2 and 3 (maybe cells are not being reused) it works as expected. Also on iOS 14, 15 it works as expected import PlaygroundSupport struct Item: Identifiable, Equatable {     let id: String     let name: String } struct App: View {          @State var items: [Item] =   [Item(id: "0", name: "Apples"),                                   Item(id: "1", name: "Oranges"),                                   Item(id: "2", name: "Bananas"),                                   Item(id: "3", name: "Pears"),                                   Item(id: "4", name: "Mangos"),                                   Item(id: "5", name: "Grapefruit"),                                   Item(id: "6", name: "Peaches"),                                   Item(id: "7", name: "Qiwies"),                                   Item(id: "8", name: "Strawberries"),                                   Item(id: "9", name: "Lemons"),                                   Item(id: "10", name: "Limes"),                                   Item(id: "11", name: "Pineapples")]     @State var selections: [Item] = []         var body: some View {         List(items) { item in             MultipleSelectionRow(title: item.name, isSelected: selections.contains(item)) {                 if selections.contains(item) {                     selections.removeAll(where: { $0 == item })                 }                 else {                     selections.append(item)                 }             }         }     } } struct MultipleSelectionRow: View {     var title: String     var isSelected: Bool     var action: () -> Void          var body: some View {         HStack {             Text(title)             if isSelected {                 Spacer()                 Image(systemName: "checkmark")             }         }         .frame(height: isSelected ? 120 : 60)         .onTapGesture {             action()         }     } } PlaygroundPage.current.setLiveView(App().previewDevice("iPhone 13"))
Replies
1
Boosts
0
Views
2k
Activity
Nov ’22
How to have different layouts for iPhone and iPad
first, I am using a translator. Please understand. want to add buttons using Auto Layout on a large image. Auto layout applied but button position incorrectly //let screenHeight = UIScreen.main.bounds.size.height Currently, the height was obtained through the above method and automatic layout was applied to each. However, too many situations had to be considered when trying to apply the iPad. Isn't there a better way?
Replies
0
Boosts
0
Views
749
Activity
Oct ’22
Warnings in NSCollectionView referencing UICollectionViewFlowLayout
Hi, I have an NSOutlineView, and each cell within that has an NSCollectionView (a horizontal one), setup using autolayout with the 'height' of the collectionView driving the height of the OutlineView cell. Each item in the collectionView can have a dynamic width, and I use a 'dummy' collectionView to size each item from it's contents, then getting the height of the collectionView and using a 'height constraint' to make each collectionView get the height it needs (and hence the cell have a dynamic height. It works fine for the most part, but I get this warning multiple times in the console: "The behavior of the UICollectionViewFlowLayout is not defined because: the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values. The relevant UICollectionViewFlowLayout instance is <NSCollectionViewFlowLayout: 0x10e3b7f80>, and it is attached to <MacTagsCustomCollectionView: 0x10e3b7840>. Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger." I've tried Googling this, but I can't find a good explanation for this issue. Also, I'm not sure why it references 'UICollectionViewFlowLayout' when it's an AppKit app and uses NSCollectionView. Also, setting the 'UICollectionViewFlowLayoutBreakForInvalidSizes' symbolic breakpoint doesn't help since it never gets triggered. Here is some code from my outlineView's viewForTableColumn, where I get the height of the collectionView and hence the height of the cell: result = [outlineView makeViewWithIdentifier:@"DataWithTags" owner:self]; if (result.tagListCollectionView.delegate == nil) { result.tagListCollectionView.delegate = self; result.tagListCollectionView.dataSource = self; result.tagsCollectionViewScrollView.automaticallyAdjustsContentInsets = NO; result.tagListCollectionView NSNib *cellNib = [[NSNib alloc] initWithNibNamed:@"MacTagsForPersonItem" bundle:nil]; [result.tagListCollectionView registerNib: cellNib forItemWithIdentifier:@"PersonTagsCollectionViewItemID"]; if (self.tagsSizingItem == nil) { NSArray *topLevelObjects; [cellNib instantiateWithOwner:self.tagsSizingItem topLevelObjects: &topLevelObjects]; for (id topLevelObject in topLevelObjects) { if ([topLevelObject isKindOfClass:[MacPersonTagsCollectionViewItem class]]) { self.tagsSizingItem = topLevelObject; break; } } } result.tagListCollectionView.backgroundColors = @[[NSColor clearColor]]; result.tagListCollectionView.enclosingScrollView.backgroundColor = [NSColor clearColor]; result.tagsCollectionViewScrollView.verticalScroller.hidden = YES; } result.tagListCollectionView.tagsPerson = person; [result.tagListCollectionView reloadData]; result.frame = outlineView.bounds; [result layoutSubtreeIfNeeded]; [result.tagListCollectionView layoutSubtreeIfNeeded]; if (person.tagsCacheHeight == 0) { &#9; person.tagsCacheHeight = result.tagListCollectionView.collectionViewLayout.collectionViewContentSize.height; } result.collectionViewHeightConstraint.constant = person.tagsCacheHeight; Anyone with any idea on how to overcome this? I feel that it's responsible for some layout issues that I'm having in the view.
Replies
2
Boosts
0
Views
2.9k
Activity
Oct ’22
How to resize items in collection view to perfectly fit bigger screen sizes?
I have a collection view with vertical flow layout. On bigger iPhones there is empty space after the 5 items in the row. Height and width and fixed at 30. There is empty space horizontally after the 5th item in the row. If i turn height and width constraint to be 'greater that of equal to' then i see just 3 items in the row and the remaining 2 appear in the row below. I find constraints very challenging and want guidance with setting them right so that the items resize on all screens to have exactly 5 items in a row from edge to edge of the collection view.
Replies
2
Boosts
0
Views
1.6k
Activity
Oct ’22
Layout glitches with Xcode 14 & iOS 16
I've upgraded to Xcode 14 and iOS 16, and now the app has a layout glitch when moving to new screens. You can see in the gif below the text and buttons move in the first few milliseconds when moving to a new screen. Any idea how to fix this? https://media.giphy.com/media/lhGlbU4YXlx1RGlaW0/giphy.gif
Replies
1
Boosts
1
Views
1.2k
Activity
Sep ’22
Size Classes for iPhone 14 in Apple Documentation wrong
Hi, I think the size classes for iPhone 14 and iPhone 14 Pro are wrong in the Apple documentation. I don't think they have "regular height" in landscape orientation. https://developer.apple.com/design/human-interface-guidelines/foundations/layout/
Replies
0
Boosts
0
Views
1.5k
Activity
Sep ’22
UICollectionView - Compositional Layout rotation problem with full screen cells
Hello guys! I'm having this weird issue with a basic compositional layout (full screen cell with horizotal swiping), on a collection view: whenever I rotate the device, it's showing the wrong cell. I think this is a problem of the content offset, because it's always jumping to the previous image (2nd to 1st, 3rd to 2nd, etc.), and this is even before the rotation started (I tried setting the cell manually in viewWillTransition, but it also jumps). And when i come back to portrait, it returns to the "original" image. Here is a gif with the slow animation: https://gifyu.com/image/S3M3d. Note that on the video the cell is changing from 2nd to 1st, but if I'm on the 3rd cell, it changes to the 2nd one. So it seems it's always to the previous one. This is the layout definition: let itemSize = NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1) ) let layoutItem = NSCollectionLayoutItem(layoutSize: itemSize) layoutItem.contentInsets = .zero layoutItem.edgeSpacing = NSCollectionLayoutEdgeSpacing(leading: .none , top: .none, trailing: .none, bottom: .none) let groupSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(1)) let layoutGroup = NSCollectionLayoutGroup.vertical(layoutSize: groupSize, subitems: [layoutItem]) layoutGroup.interItemSpacing = .fixed(0) let layoutSection = NSCollectionLayoutSection(group: layoutGroup) layoutSection.interGroupSpacing = 0 layoutSection.orthogonalScrollingBehavior = .groupPaging let collectionViewLayout = UICollectionViewCompositionalLayout(section: layoutSection) let collectionView = UICollectionView(frame: .zero, collectionViewLayout: collectionViewLayout) collectionView.translatesAutoresizingMaskIntoConstraints = false collectionView.backgroundColor = .clear collectionView.bounces = false collectionView.isPagingEnabled = true collectionView.showsHorizontalScrollIndicator = false collectionView.delegate = self collectionView.dataSource = self collectionView.register(CustomCell.self, forCellWithReuseIdentifier: "...") I've tried everything (removed every spacing, inset, and all that I could find), but I can't make it work. Any ideas? It's been driving me crazy. Thanks in advance.
Replies
0
Boosts
1
Views
1.5k
Activity
Sep ’22
UICollectionViewRecursion when using estimated sizes in Compositional Layout
Hi everyone, our team was transferred a project that is using a "UICollectionViewCompositionalLayout" for displaying a large amount of data. On iOS 14 and below, we seemed to be having no problems. Now on iOS 15 however, we keep getting this debugger message: APPNAME[47924:507017] [UICollectionViewRecursion] cv == 0x7ff2af9d0200 Disabling recursion trigger logging We are also collecting crashes in our crash tool, solely from iOS 15 devices, saying: NSInternalInconsistencyException: UICollectionView (<UICollectionView 0x1122a6400>) is stuck in its update/layout loop. This can happen for many reasons, including self-sizing views whose preferred attributes are not returning a consistent size. To debug this issue, check the Console app for logs in the "UICollectionViewRecursion" category. We've found that setting all .estimated() sizes we're using in the section provider to .absolute() gets rid of the message, but of course the views aren't sized correctly then. We are using views that size themselves based on the content they display, using UIStackViews. We need them to be dynamic in height. Has something changed moving from iOS 14 to 15 about how the compositional layout has to be configured? Is there something we can do to further debug this issue? I've found some questions about this asked on StackOverflow, but none of them were answered either.
Replies
8
Boosts
2
Views
7.4k
Activity
Sep ’22
Crashlytics : iOS Crash : CoreAutoLayout _col_rawAddForEngineVar
CoreAuto layout crash issue I absolutely do not have any idea, what can occure this problem and how can i reproduce. It crashes randomly. I use Crashlytics v3.14 in my project. Does anybody face with the same problem? Crashlytics : iOS Crash : CoreAutoLayout _col_rawAddForEngineVar Crash Item : _col_rawAddForEngineVar Issue Details : Crashed: com.apple.main-thread 0 CoreAutoLayout 0xbb20 _col_rawAddForEngineVar + 180 1 CoreAutoLayout 0x5990 _engineVar_addForVariableIfNeeded + 464 2 CoreAutoLayout 0x152f0 -[NSISLinearExpression setCoefficient:forVariable:] + 56 3 CoreAutoLayout 0xc9e8 -[NSLayoutConstraint _lowerIntoExpression:reportingConstantIsRounded:] + 188 4 CoreAutoLayout 0xef4c -[NSLayoutConstraint _addToEngine:mutuallyExclusiveConstraints:] + 140 5 UIKitCore 0x1df1ec __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 372 6 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 7 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 8 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 9 UIKitCore 0x1df134 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 188 10 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 11 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 12 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 13 UIKitCore 0x1df134 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke_2 + 188 14 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 15 UIKitCore 0x1ccf70 __57-[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:]_block_invoke + 560 16 UIKitCore 0x3ba200 -[UIView(AdditionalLayoutSupport) _switchToLayoutEngine:] + 216 17 UIKitCore 0x4845c0 -[UIView(AdditionalLayoutSupport) _initializeHostedLayoutEngine] + 212 18 UIKitCore 0x1ecdd8 -[UIView _layoutEngine_windowDidChange] + 124 19 UIKitCore 0x2b6de0 -[UIView(Internal) _didMoveFromWindow:toWindow:] + 280 20 UIKitCore 0x2b706c -[UIView(Internal) _didMoveFromWindow:toWindow:] + 932 21 UIKitCore 0x1dd82c __45-[UIView(Hierarchy) _postMovedFromSuperview:]_block_invoke + 140 22 CoreAutoLayout 0x85c4 -[NSISEngine withBehaviors:performModifications:] + 88 23 UIKitCore 0x26d060 -[UIView(Hierarchy) _postMovedFromSuperview:] + 840 24 UIKitCore 0x189b90 -[UIView(Internal) _addSubview:positioned:relativeTo:] + 2152 25 UIKitCore 0x3b0638 -[UITableView _addSubview:positioned:relativeTo:] + 108 26 UIKitCore 0x178554 -[UIScrollView _addContentSubview:atBack:] + 380 27 UIKitCore 0x19e01c -[UITableView _addContentSubview:atBack:] + 252 28 UIKitCore 0x19a754 __53-[UITableView _configureCellForDisplay:forIndexPath:]_block_invoke + 1772 29 UIKitCore 0x1729a8 +[UIView(Animation) performWithoutAnimation:] + 104 30 UIKitCore 0x419dbc -[UITableView _configureCellForDisplay:forIndexPath:] + 272 31 UIKitCore 0x286ac4 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 1788 32 UIKitCore 0x484030 -[UITableView _updateVisibleCellsForRanges:createIfNecessary:] + 732 33 UIKitCore 0x2abbbc -[UITableView _updateVisibleCellsNow:] + 1432 34 UIKitCore 0x17bed8 -[UITableView layoutSubviews] + 456 35 UIKitCore 0x18c17c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2592 36 QuartzCore 0x407fc CA::Layer::layout_if_needed(CA::Transaction*) + 532 37 QuartzCore 0x32c60 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 136 38 QuartzCore 0x475b4 CA::Context::commit_transaction(CA::Transaction*, double, double*) + 452 39 QuartzCore 0x504a8 CA::Transaction::commit() + 704 40 QuartzCore 0x323a0 CA::Transaction::flush_as_runloop_observer(bool) + 88 41 CoreFoundation 0x410c4 CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 36 42 CoreFoundation 0x10080 __CFRunLoopDoObservers + 592 43 CoreFoundation 0xb13c __CFRunLoopRun + 1052 44 CoreFoundation 0x1ebc8 CFRunLoopRunSpecific + 600 45 GraphicsServices 0x1374 GSEventRunModal + 164 46 UIKitCore 0x514b58 -[UIApplication _run] + 1100 47 UIKitCore 0x296090 UIApplicationMain + 364 48 TCP App 0xbad894 main + 39 (AppDelegate.swift:39) 49 ??? 0x10674dda4 (Missing)
Replies
0
Boosts
0
Views
1.1k
Activity
Sep ’22
How to programmatically access font style on UILabel?
Hi, In an iOS app, I have a Storyboard View Controller with a UILabel on it where I set the font style to Body/Heading/whatever with dynamic fonts. This all works fine. However, is there a way in the VC code to extract that font style? I've looked at the associated font and font descriptor for the UILabel but don't see an obvious attribute for it. Any idea how to see it? I would prefer not to hardcode it and extract it from the UILabel instead. I need it as I will be modifying portions of the text (bold, etc.). Regards, Patrick
Replies
0
Boosts
0
Views
1.3k
Activity
Aug ’22
Why are my equally-constrained UIViews not rendered with the same size?
Howdy! I have a view which is constrained to a height of 0.5 and is reused in several places. When several are rendered near each other however, it becomes clear that their heights are subtly different (but enough to annoy me!). It doesn't appear as if any constraints are breaking. For additional information, I am trying to roughly replecate the appearance of the UITableView seperator in some of my views. Hints on how UIKit manages to ensure that a UITableView's seperators all appear to be the same height will also be appreciated. Thanks, smkuehnhold
Replies
6
Boosts
0
Views
1.4k
Activity
Aug ’22
Vary for Traits in Xcode 13 beta?
In the Xcode 13 beta, where's the Vary For Traits button?
Replies
6
Boosts
0
Views
4.9k
Activity
Jul ’22
Need help with autolayout solution
Views A and B are equal in width (set up via a constraint). The actual width will vary at runtime. What I want to do is arrange view A such that it is horizontally centered on B but offset to the left by 1/10th of the total width. In other words, if views A and B were 100 units in length, I'd want A to be positioned 10 units to the left of B. If the width were 150 units then the A position would be 15 to the left, etc. I thought I could do this with either a leading constraint or a centerX constraint using a multiplier of 0.9, but it isn't working out the way I want. What's the best solution?
Replies
1
Boosts
0
Views
699
Activity
Jul ’22
Memory Crash on layoutIfNeeded()
Can anyone help me diagnose this crash. It happens in the animation block on the layoutIfNeeded() function call. Full function and. crash report attached.     private func showWarningView() {         DispatchQueue.main.async { [weak self] in             guard let strongSelf = self else { return }             if let safeAreaHeight = strongSelf.superview?.safeAreaLayoutGuide.layoutFrame.size.height {                 let visibleBannerHeight: CGFloat = strongSelf.isBannerVisible ? strongSelf.bannerHeight : 0                 let newConstraintConstant = (safeAreaHeight - strongSelf.externalBottomOffset - visibleBannerHeight) - strongSelf.warningBannerHeight                 strongSelf.addInternalBottomOffset(with: strongSelf.warningBannerHeight)                 strongSelf.warningViewTopConstraint.constant = newConstraintConstant             }             strongSelf.isWarningViewVisible = true             let showWarningView = UIViewPropertyAnimator(duration: 0.25, curve: .easeIn, animations: {                 self?.layoutIfNeeded()             })             showWarningView.startAnimation()         }     } Crash Report
Replies
0
Boosts
1
Views
1.7k
Activity
Jun ’22
Label wrapping issue - iOS 16 beta
Hello, does anyone experience this issue on the iOS 16 beta? The text wrapping in a simple label seems it is different in the iOS 16 beta. As you can see in the image attached, the "essentially" text goes to the line below in the iOS 16 beta, this is just a dummy example but we have seen a lot of screens where this wrapping happens. For the record: it is the same label with the same leading and trailing constraints values, the only thing that has changed is the IOS version. As our app needs to be "Pixel-perfect" this is a problem because we have a lot of screens to fix and we want to avoid adding iOS version logic in the code.
Replies
2
Boosts
0
Views
1.9k
Activity
Jun ’22
CoreAutoLayout -[NSISEngine withAutomaticOptimizationDisabled:]
Xcode version: 13.2.1 (13C100) plateform: iOS Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x99288 __exceptionPreprocess 1 libobjc.A.dylib 0x16744 objc_exception_throw 2 CoreAutoLayout 0x57ac -[NSISEngine withAutomaticOptimizationDisabled:] 3 CoreAutoLayout 0xaa6c -[NSISEngine _optimizeWithoutRebuilding] 4 CoreAutoLayout 0xcb78 -[NSISEngine optimize] 5 CoreAutoLayout 0x50fc -[NSISEngine performPendingChangeNotifications] 6 UIKitCore 0x350710 -[UIView(Hierarchy) layoutSubviews] 7 UIKitCore 0x18bfb4 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] 8 QuartzCore 0x40cd0 CA::Layer::layout_if_needed(CA::Transaction*) 9 QuartzCore 0x33134 CA::Layer::layout_and_display_if_needed(CA::Transaction*) 10 QuartzCore 0x47a7c CA::Context::commit_transaction(CA::Transaction*, double, double*) 11 QuartzCore 0x50970 CA::Transaction::commit() 12 QuartzCore 0xa89a8 CA::Transaction::release_thread(void*) 13 libsystem_pthread.dylib 0x1e58 _pthread_tsd_cleanup 14 libsystem_pthread.dylib 0x48d0 _pthread_exit 15 libsystem_pthread.dylib 0x13b8 pthread_main_np 16 libsystem_pthread.dylib 0x1144 _pthread_wqthread 17 libsystem_pthread.dylib 0xe5c start_wqthread
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’22
untime: Layout Issues: Position and height are ambiguous for UIInputSetContainerView.
User case : I am using swiftui with UIHostingController on my app. My entire view is messed up when the keyboard is presented for a text field. This problem happens if - Keyboard is presented in another controller with UIKit text field and then came to this (SwiftUI) screen and the Keyboard is presented for the swiftUI textfield.
Replies
0
Boosts
0
Views
711
Activity
May ’22