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
1
vote
1 answer

Section Insets not respected when rendering the cells of UICollectionView

I have a UICollectionView containing two sections. I have given section insets of left = 5 and right = 5 from storyboard. I am using the same .xib for cells of both the sections. I am inputting the size of the cells in sizeForItemAtIndexPath …
MrDank
  • 2,020
  • 2
  • 17
  • 39
1
vote
0 answers

iOS: Map view location with edge padding

I have a MKMapView which shows the user location and also a MKUserTrackingBarButtonItem. I added an edge padding with this line: mapView.setVisibleMapRect(mapView.visibleMapRect, edgePadding: UIEdgeInsetsMake(0.0, 0.0,…
Florentin
  • 1,433
  • 2
  • 13
  • 22
1
vote
1 answer

Using UIEdgeInsets to position scrollView below NavController and Let it scroll behind IN SWIFT

I am using swift and the couple of accessor functions as fallows: let inset: UIEdgeInsets = UIEdgeInsetsMake(0,64,0,0) collection.scrollIndicatorInsets(inset) collection.contentInset(inset) however I am getting an odd error: '(UIEdgeInsets) ->…
CWineland
  • 615
  • 7
  • 18
1
vote
0 answers

does setImageEdgeInsets effect setTitleEdgeInsets? why the title's left inset should be negative to let title centerd in button

I want to show image and title both in a button, then i try the setImageEdgeInsets and setTitleEdgeInsets.But it makes me confused. Before setting the insets property, the button likes below ( Black rect represent the button bounds, Red rect…
pinchwang
  • 353
  • 1
  • 2
  • 13
1
vote
3 answers

contentInset of the UIScrollView isn't working

I’m trying to move the content up when the keyboard appears. This is the content which is a simple login form. Please note that these are not UITextFields. Its just a small UITableView in the middle of a UIViewController. And I have a UIScrollView…
Isuru
  • 30,617
  • 60
  • 187
  • 303
1
vote
1 answer

Trying to move my custom UITextField clear button but it won't size or move correctly

So I have a custom clearButton for my generic UITextField. I am trying to move the clearButton as the background of my uitextfield has some design stuff on the right side. I need the clear button to be pushed over about 150 pixels. I tried all…
jdog
  • 10,351
  • 29
  • 90
  • 165
1
vote
0 answers

Get the UIEdgeInsets from subtracting 2 CGRects

I have a CGRect "A" contained in another CGRect "B" I'm not sure on how UIEdgeInsets are calculated - and I keep getting the arithmatic wrong - what I need is the edge insets (= "EI") such that "A" will be equal to "B" after…
Avba
  • 14,822
  • 20
  • 92
  • 192
1
vote
0 answers

What is the proper way to manually manage a UITableView's contentInset in iOS 7?

I have two UITableViewControllers embedded in separate fullscreen container views within a single view controller, with a segmented control bar button item to toggle between them (like in the App Store's top charts). Since there are two scroll views…
1
vote
0 answers

iOS7 - UITabBar - Transparent doesn’t work

I m using custom UITabBar in my app and i set the translucency to NO: if ([self.tabBar respondsToSelector:@selector(setTranslucent:)]) [self.tabBar setTranslucent:NO]; I have UIViewController with this .xib: In the white area i have a…
gran33
  • 12,421
  • 9
  • 48
  • 76
1
vote
2 answers

iOS 7 - UITextView clipping text

I'm trying to fit 3 lines of text in a textview of a certain size by using [_messageField setContentInset:UIEdgeInsetsMake(-8, -6, 0,0)]; This works in iOS 6, but iOS 7 seems to be clipping content at the bottom of the textview. Both of the…
davis
  • 1,911
  • 6
  • 26
  • 50
1
vote
1 answer

-[UIImage resizableImageWithCapInsets] stretching wrong

So, I have a .png image that is (640, 960) pixels in dimension. I'm trying to create a resizable image from the .png in order to stretch that image vertically and fit an iPhone 5's (640, 1096) pixel view. I'm loading the image using +[UIImage…
Patrick Perini
  • 22,555
  • 12
  • 59
  • 88
1
vote
1 answer

iOS / Obj-C: Removing the padding from UIButton titles

I am trying to create a very thin UIButton with size = CGSizeMake(75, 23) to fit a customized background image exactly. And I would like the button to have a title. After I call setTitle:forState: the button is resized to account for padding around…
Andre Gregori
  • 1,150
  • 1
  • 10
  • 17
1
vote
2 answers

Table view not adjusting to keyboard properly

I have a custom inherited UIView class with a UITableView within it as its only subview. I'm trying to mimic the normal functionality of the UITableViewController when the keyboard is shown to adjust the contentInset and scrollIndicatorInsets of the…
Anna
  • 239
  • 1
  • 7
  • 21
0
votes
3 answers

UiTableview ContentInset

I am working on very small app. In this app I am using UIrootviewController's table view to display some content in it. I want that content to be displayed at particular position so I am setting its contentInset. when I do it in viewDidLoad or in…
0
votes
1 answer

SwiftUI Path.inset(in:) function

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 frame = CGRect(origin: .zero, size: CGSize(width:…
Bram
  • 2,718
  • 1
  • 22
  • 43
1 2 3
8 9