Skip to main content
Filter by
Sorted by
Tagged with
1 vote
0 answers
72 views

I am trying to make create a view which incorporates a button and a picker in a HStack to eventually be placed inside a form. I would like the button to seamlessly blend with the edges of the list row ...
miothethis's user avatar
1 vote
1 answer
537 views

I have the following problem: I want to add horizontal insets to a collectionView's contentView, but when I set the contentInset to UIEdgeInsets(top: .zero, left: 64, bottom: .zero, right: 64) for ...
schmittsfn's user avatar
  • 1,442
0 votes
1 answer
559 views

I'm trying to inset a path by a constant amount, but for some reason, it appears this is not working. What am I doing wrong? This works fine; it draws a rectangle of 250x250 with a red border. let ...
Bram's user avatar
  • 3,311
3 votes
1 answer
763 views

I have a UIViewController as the root of a UINavigationController and I have set the preference for large titles as follows navigationController?.navigationBar.prefersLargeTitles = true My goal is to ...
Shawn Frank's user avatar
  • 5,303
0 votes
1 answer
240 views

I need to attach title of UIButton to the top-right corner, but when I use .contentVerticalAlignment property, there is a space between the top and the title. class ViewController: UIViewController { ...
ergl1s's user avatar
  • 1
1 vote
0 answers
2k views

I want to make a padding for tableView's content. The result should be the following: Result I want to achieve If I use tableView.contentInset = UIEdgeInset(...) like this: func setStandartDesign() { ...
Арсений Токарев's user avatar
1 vote
0 answers
824 views

I'm working on a nice screen rotation animation in my iOS app. When the screen's size changes, I update the (Metal) model inside it accordingly. The problem is that I have visual content "jumps&...
olha's user avatar
  • 2,302
2 votes
1 answer
157 views

I am implementing a menu, which holds severals buttons within two columns and I want the button text to be centered in the middle for every cell. This is what it looks like right now: This is my ...
OuttaSpaceTime's user avatar
0 votes
1 answer
3k views

I've been trying different ways on the Playground, but the margins are not being implemented. I'm trying to understand the proper way of using UIEdgeInsets (and NSDirectionalEdgeInsets). The ...
Kevvv's user avatar
  • 4,103
0 votes
1 answer
301 views

I use this UILabel extension for label padding in a lot of areas in my projects. And it works perfectly on iOS 13 and older version devices. But it doesn't work at all on iOS 14 devices and Simulators....
Hilalkah's user avatar
  • 1,055
0 votes
1 answer
56 views

I'm playing with Navigation Bar Buttons I need a button from right edge with 0 space, after google search i found below code self.filterButton = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 80, ...
Bittoo's user avatar
  • 589
7 votes
2 answers
792 views

I am using XCode System Images (SF Symbols) for UITabBarItem Images. I'd like to remove the UITabBarItem Title which I have done. But also move the UITabBarItem Image down slightly. In the past ...
David Henry's user avatar
  • 3,090
1 vote
2 answers
1k views

I am using iOS's system icons so that I can have a consistent user interface throughout my project. One thing that I've noticed when using these icons is that, even if I set a system icon as the image ...
David Chopin's user avatar
  • 2,574
0 votes
1 answer
841 views

I'm using a UIActivityViewController to print (amongst other activities). So I pass it an instance of my custom subclass of UIPrintPageRenderer, for which the relevant code is below. In essence, I ...
Son of a Beach's user avatar
10 votes
2 answers
10k views

I have a TableView inside a ViewController. I made the TableView stretch to the View SuperMargings (with constraints) and disabled all SafeArea Inset options but my TableView is still under the ...
helloimbrando's user avatar
1 vote
2 answers
111 views

I created a button in interface builder. Set fixed width = 120 and height = 40 constraints to this button. After I add an image to button and set image insets (top: 10, left: 0, bottom: 10, right: 100)...
deewaiz's user avatar
  • 11
0 votes
1 answer
1k views

I have a UICollectionView with multiple sections. I would like to add bottom inset to the entire collectionView. All the Q&As suggest to use the following function: func collectionView(_ ...
Luda's user avatar
  • 7,108
0 votes
1 answer
357 views

I would like to get rid of the spacing between the top of the UIButton image and the top border of the UIButton as well as the bottom of the UIButton image and the bottom border of the UIButton (refer ...
Shadi Hammoudeh's user avatar
0 votes
0 answers
80 views

How do I put some space between the left side of a label and the beginning of the text? I try to adjust the edge insets, but it is get only. The code: label.alignmentRectInsets = UIEdgeInsets(top: 2,...
daniel's user avatar
  • 1,036
1 vote
0 answers
697 views

I have a UIScrollView under a navigationbar in a detail viewcontroller. The viewcontroller settings are the following: The scrollview is pinned to the Safe Area (trailing, leading, bottom, top = 0). ...
3000's user avatar
  • 187
0 votes
1 answer
863 views

I have a UITableViewCell which contains a UITextView. I'd like to set padding on this text view, so that the cell content is pushed in by 10 on each side. I understand I can do this in code using ...
Harry Blue's user avatar
  • 4,562
2 votes
1 answer
3k views

I would like to use NSDirectionalEdgeInsets to UIButton's contentEdgeInsets and titleEdgeInsets. Is that possible? Background For localization purposes, an iOS application may be required to adapt ...
om-ha's user avatar
  • 3,672
3 votes
2 answers
5k views

I'm styling a UILabel programmatically and having trouble getting any padding around the label's text: After studying many SO threads on the subject (this one, in particular) I thought I'd found a ...
Jim's user avatar
  • 1,550
2 votes
1 answer
771 views

I've created a custom UILabel in order to be able to change its safe area so the text could have some padding and look nicer, but after I changed my safeArea the text still go all the way from edge to ...
Lucas's user avatar
  • 786
0 votes
1 answer
113 views

I got a UIStackView ParticipateButtonStackView managing three buttons of the same class: ParticipateButton These buttons only contain an image. To have some padding at the top and bottom, I set ...
Noodledew's user avatar
  • 519
0 votes
1 answer
839 views

I have a UICollectionView that scrolls vertically. The collection view is a form. It has multiple sections, each section has a few items in it. The top section has a header which is pinned to the top ...
tentmaking's user avatar
  • 2,136
0 votes
1 answer
198 views

I have this UINavigationBarButton I am making with an image inside of it that is originally square. I have used this code on other regular buttons and it has made the images round. However, it is not ...
Levi's user avatar
  • 653
0 votes
0 answers
970 views

I want to the image image normal state. and for button selected state, In the selected state I need a line at the bottom of the button. I am setting a image as the button title and I can adjust the ...
Vineesh TP's user avatar
  • 8,023
11 votes
4 answers
12k views

I'm trying to set some insets in a UILabel. It worked perfectly, but now UIEdgeInsetsInsetRect has been replaced with CGRect.inset(by:) and I can't find out how to solve this. When I'm trying to use ...
Jacob Jidell's user avatar
  • 2,852
2 votes
1 answer
246 views

I'm having an issue when trying to layout a view programatically and I cant seem to find a concise, non hacky way to fix it. I'm using safeAreaInsets to size some elements in my view. This works well ...
Craigt's user avatar
  • 3,600
0 votes
2 answers
1k views

My UICollectionView always scrolls a bit up when clicking on a UICollectionViewCell. I noticed that this behavior does not occur if I set the collection view inset to 0 (no inset at all) and the ...
j3141592653589793238's user avatar
11 votes
4 answers
3k views

Using Swift 4.2 with Xcode 10 beta, if I write: import UIKit let foo: UIEdgeInsets = .zero Then I get a fatal error at compile time: *** DESERIALIZATION FAILURE (please include this section in any ...
Cœur's user avatar
  • 39k
0 votes
1 answer
805 views

I have a collectionview with content edge insets 8 pixels from both the top and bottom. When I invoke scrollToItemAt of the collection to the very last item, it scrolls down but is 8 pixels short of ...
Chris's user avatar
  • 306
0 votes
1 answer
462 views

I have code for my collectionView that adjusts the content so that it sits beneath the navigation bar. collectionView.contentInsetAdjustmentBehavior = .never let tabBarHeight = self....
Khoury's user avatar
  • 421
1 vote
0 answers
572 views

I'm working with a UITableView. The table view has a HeaderView with a UIImageView that changes its height when the user scroll the table view. In addition to this I also have a custom uiview for the ...
kAiN's user avatar
  • 2,823
-3 votes
1 answer
2k views

I am new in Swift 4 and I want to resolve the Swift version 2.0 Project with Uitextview error here is error in Swift 4 let textView = UITextView(frame: CGRectInset(view.bounds, 10, 10)) I will ...
user2296278's user avatar
0 votes
2 answers
5k views

I'm trying to set up a horizontally scrolling collection view that has cells with size CGSize(width: view.frame.width, height: view.frame.height). However, my cells are partially covered at the top by ...
Explorer's user avatar
0 votes
0 answers
373 views

I want to set the images of tab bar items a bigger size. So I put this code in my TabBarViewController.viewDidLoad(): let titleTabrItems = ["Favourites","Calc","Time","Live","Shop"] for (...
cicaletto79's user avatar
1 vote
0 answers
2k views

I'm new to the game so I've really only worked with iOS 11 and have recently acquired heartburn trying to figure out what Apple had in mind with their now-deprecated inset behaviors in iOS 10. And ...
youareawaitress's user avatar
7 votes
1 answer
16k views

I have a UITableViewCell with content that extends to all of its edges. I use this cell in multiple tables with where it needs varying insets. (i.e. one table will have it inset from the left by 8 ...
Justin Vallely's user avatar
2 votes
1 answer
269 views

After couple of days struggling I wanted to ask you about UIButton title and image edge insets... I have custom cell with button and on that button depends on cell type should be different icons and ...
mihatel's user avatar
  • 846
0 votes
1 answer
91 views

This post is to complete one I made a while ago titled Text padding on UILabel, left with no answer. The screenshot below shows it all. The first label, though the shortest is truncated. The second ...
Michel's user avatar
  • 11.9k
1 vote
0 answers
2k views

I'm trying to detect if the current device is an iPhone X in Objective-C. I've looked at some other posts that do this in Swift and a proper method seems to be to compare the safe area insets with ...
Brandon Lee's user avatar
2 votes
1 answer
959 views

Here, I am trying to have a label with some padding (left, right, top and bottom) around the text. This issue has related post on SOF and after reading a few of them, I tried using a solution proposed ...
Michel's user avatar
  • 11.9k
1 vote
1 answer
265 views

I notice the tap area for my UIButton got smaller since iOS 11. To confirm, I commented out the desired background color on its subviews and put purple color on the button itself. iOS 10.0.3 (Button ...
tsuyoski's user avatar
  • 644
2 votes
2 answers
9k views

I have a "plain" style UITableView. I am setting a view as the tableViewHeader for the table view. The table also shows the section index down the right side. My issue is figuring out how to inset ...
rmaddy's user avatar
  • 319k
0 votes
1 answer
87 views

I have an issue with UITabBarController, the icons are changing size if I keep my finger on them and drag up or down, they are losing height by my dragging action, how can I stop that? Here is my ...
Kodr.F's user avatar
  • 14.5k
1 vote
1 answer
153 views

I'm trying to add a padding to the right of a navigationBar rightBarButtonItems in between the buttons but it's now working. Here's the button creation code with the given inset: lazy var ...
Ivan Cantarino's user avatar
0 votes
1 answer
673 views

I wanted to increase the button touch area without without actually increasing its original size. When it comes to insets there are so many in Button and there is no clear documentation I could find ...
Shiva's user avatar
  • 585
0 votes
1 answer
538 views

I'm trying to do a custom uislider using images (without a visible knob, i hide it when user can't edit and show it when he can) The problem is that the the side render perfectly but the right part is ...
Kevin Vacquier's user avatar