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
0
votes
1 answer

UICollectionView with Insets Not Scrolling All the Way Down

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 the very bottom of the collectionview, which I'm…
Chris
  • 431
  • 8
  • 33
0
votes
1 answer

Why does iPhone X ignore UIEdgeInsets for UICollectionView?

I have code for my collectionView that adjusts the content so that it sits beneath the navigation bar. collectionView.contentInsetAdjustmentBehavior = .never let tabBarHeight = self.tabBarController?.tabBar.bounds.height let…
Khoury
  • 411
  • 1
  • 4
  • 21
0
votes
2 answers

programmatically adjust collectionView for safeArea

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 the navigation bar and using edge insets doesn't…
0
votes
0 answers

Tab bar item scales if click twice or more

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 (index,item) in (self.tabBar.items ?? []).enumerated()…
cicaletto79
  • 179
  • 1
  • 12
0
votes
1 answer

Text padding on UILabel not working

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 and the third even more have far too wide spaces on…
Michel
  • 10,303
  • 17
  • 82
  • 179
0
votes
1 answer

UITabBarController icons changing height on touch

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 code: override func viewWillAppear(_ animated: Bool)…
Kodr.F
  • 13,932
  • 13
  • 46
  • 91
0
votes
1 answer

how to set the values for UIEdgeinset for button

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 on the differences Content Insets Title…
Shiva
  • 545
  • 1
  • 10
  • 41
0
votes
1 answer

Custom UISlider using UIEdgedInset does not render well

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 cute and doesn't seems to use the edges... Any…
Kevin Vacquier
  • 622
  • 6
  • 17
0
votes
1 answer

Set UICollectionView's UIEdgeInsets

I wanted items of UICollectionView's to be in center so I wrote the following code: func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAtIndex section: Int) -> UIEdgeInsets { …
0
votes
0 answers

iOS resize UIButton image

I'm trying to create a button for adding an image which has a small camera icon next to the text "add image". I have managed to get this result with the following code: let btn = UIButton(type: .system) let img = UIImage(named: "camera") …
Developer
  • 736
  • 7
  • 30
0
votes
0 answers

Remove paddingTop in UICollectionView Xamarin.iOS

I am developing an iOS app using Xamarin.iOS . I have used UICollectionView to display a list of categories. I have used StoryBoard to design the interface. I have one problem: CollectionView has a padding from the top. As far as I got it has to do…
Xhulio
  • 581
  • 7
  • 26
0
votes
1 answer

Extra White Space in Horizontal Scrollview of UITableViews

Here is my code: - (void)viewDidLoad { [super viewDidLoad]; [self.view setBackgroundColor:[self colorWithHexString:@"d944f7"]]; self.pageControl = [[UIPageControl alloc] init]; self.scrollView = [[UIScrollView alloc]…
ChuckKelly
  • 1,742
  • 5
  • 25
  • 54
0
votes
1 answer

UICollectionView Bounds Width is always 600

I have a custom UIView say CustomView which has a UICollectionView as its SubView. I have added this customView inside a UITableView Prototype Cell and pined all four (top, bottom, left, right) edges to the standard distance with…
Madu
  • 4,849
  • 9
  • 44
  • 78
0
votes
1 answer

How to adjustsFontSizeToFitWidth to UIButton label ? ios

when i set adjustsFontSizeToFitWidth to the button UILabel, the text go out side of the button frame, I don't know why ? here is my code: shareBtn = UIButton() shareBtn.setTitle(IconsConstants.share, forState:…
david
  • 3,310
  • 7
  • 36
  • 59
0
votes
3 answers

Present view controller on last item of UICollectionView

I'm making simple chat application, so when users taps on specific chat in chat list he must go to last message in this specific chat room (like in Telegram). I tried to create own scrollToBottom function: func scrollToBottom(animated animated:…
pavel_s
  • 465
  • 1
  • 7
  • 27
1 2 3
8 9