Questions tagged [uiedgeinsets]

UIEdgeInsets is an iOS data type that defines inset distances for views.

UIEdgeInsets defines inset distances for views. Edge inset values are applied to a rectangle to shrink or expand the area represented by that rectangle. Typically, edge insets are used during view layout to modify the view’s frame. Positive values cause the frame to be inset (or shrunk) by the specified amount. Negative values cause the frame to be outset (or expanded) by the specified amount.

It is available in iOS 2.0 and later.

Source: UIEdgeInsets

Related SO questions:

  1. How does UIEdgeInsetsMake work?

  2. UIEdgeInsetsMake creating a weird band on the cell, and I don't know how to fix it

  3. Shrink UIButton's frame after setting UIEdgeInsets

Related tags:

132 questions
2
votes
1 answer

Shrink UIButton's frame after setting UIEdgeInsets

I hope, that it's quite simple question, but how I can fit UIButton's frame after following code (project without arc and *.nibs): _fotosButton = [UIButton buttonWithType: UIButtonTypeCustom]; [_fotosButton setImage: [UIImage imageNamed:…
Aliaksandr B.
  • 146
  • 16
2
votes
1 answer

TableView inside Navigation Controller: Zero Edge Insets on the Left and on the Right?

I have got a TableView inside a Navigation Controller. By default, the TableView has edge insets set on the left and on the right. That is, the content's width in the TableView is smaller than iPhone width. My designer wants me to have the content…
user1006117
  • 431
  • 4
  • 16
1
vote
0 answers

UITableViewController's tableView's Content insets

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() { ... …
1
vote
0 answers

How to deal with temporarily incorrect SafeAreaInsets?

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" due to the buggy info from the VC's lifecycle…
olha
  • 2,132
  • 1
  • 18
  • 39
1
vote
2 answers

iOS System Icons not respecting UIButton's UIImageInsets

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 for a UIButton, it will not grow to fill the…
David Chopin
  • 2,780
  • 2
  • 19
  • 40
1
vote
2 answers

Different title origin of UIButton with image inside in different iOS versions

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) to move the image to the left side. UIButton…
deewaiz
  • 11
  • 2
1
vote
0 answers

How do I extend the scrollview top under a navigation bar in iOS 12?

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). I want to put the entire scrollview below/under…
3000
  • 187
  • 1
  • 12
1
vote
0 answers

UITableView viewForHeaderInSection Issue with UITableView content Inset

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 section of the tableview .. My problem is that…
kAiN
  • 2,559
  • 1
  • 26
  • 54
1
vote
0 answers

UIScrollView automatic content inset behavior working in iOS 11 but not iOS 10?

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 Apple's documentation for UIScrollView inset…
youareawaitress
  • 387
  • 2
  • 17
1
vote
0 answers

Objective-C: Detect iPhone X with Safe Area Insets

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 UIEdgeInsets.zero. However, whenever I attempt to do…
1
vote
1 answer

UIButton tap area got smaller on iOS 11

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 shown as desired) iOS 11.1 (Tap area got…
tsuyoski
  • 614
  • 5
  • 22
1
vote
1 answer

BarButtonItem EdgeInsets doesn't work

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 previewBarButtonItem: UIBarButtonItem = { let buttonItem…
Ivan Cantarino
  • 3,058
  • 4
  • 34
  • 73
1
vote
1 answer

Add text above image in UIButton

So I have UIButton's all over various VC's and Scenes on my game. Some with images others just plain text. So I want to combine both. I know I can do both but the button is then in the background. Is there anyway I can make sure that the text is…
insta catering
  • 151
  • 2
  • 12
1
vote
6 answers

How to change tintColor of image in UIButton with imageEdgeInsets?

I I have an UIButton in my objective-c application. My button was modified adding text and image like: - (void)centerButtonAndImageWithSpacing:(CGFloat)spacing { CGFloat insetAmount = spacing / 2.0; self.imageEdgeInsets =…
user3745888
  • 6,143
  • 15
  • 48
  • 97
1
vote
0 answers

Cast from AnyObject to UIEdgeInsets

I'm trying to use KVO pattern on scrollView's contentInset and i need to know about old/new values. I know UIEdgeInests is a struct hence can not be stored in Dictionary, but i receive it in changes. this is my change Dictionary: Optional(["old":…
farzadshbfn
  • 2,710
  • 1
  • 18
  • 38
1 2 3
8 9