uiedgeinsets

How can I remove or change the UIEdgeInset of these two UITableViewCellSeparators?

亡梦爱人 提交于 2019-12-11 22:43:42
问题 I have this UITableViewController, and I wanted to change the separators' edge insets. I have managed to change the ones between cells, but the two line I have shown in the image below is not changing. The top one is the line just below the section header view, and the other one is (I suppose) the line just above the section footer view, but I have not added or changed the latter. Many thanks in advance 回答1: That's what you get for using the grouped tableView style. Anyways... since it seems

UITextView contentInset is not working

限于喜欢 提交于 2019-12-07 12:48:17
问题 I'm displaying text inside UITextView. I need to apply some padding to text. When i use value for top position it's working. If i use value for other position it's not working. txtt_bgImage = [UIImage imageNamed:@"txtt_bg_ipad.png"]; txtt_bgImageView = [[UIImageView alloc] initWithImage:txtt_bgImage]; txtt=[[UITextView alloc]initWithFrame:CGRectMake(170, 300, 400, 250)]; txtt.text=productDescription; [txtt setFont: [UIFont fontWithName:@"verdana" size:15]]; txtt.textColor=[UIColor whiteColor]

Text padding on UILabel

偶尔善良 提交于 2019-12-06 07:59:41
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 here : This is the code for my subclassing UILabel: import UIKit class LuxLabel: UILabel { //let padding: UIEdgeInsets var padding: UIEdgeInsets = UIEdgeInsets.zero { didSet { self.invalidateIntrinsicContentSize() } } // Create a new PaddingLabel instance programamtically with the desired insets required init(padding: UIEdgeInsets = UIEdgeInsets(top: 0, left: 10, bottom: 0, right: 10)) { self

UITextView contentInset is not working

…衆ロ難τιáo~ 提交于 2019-12-05 20:53:11
I'm displaying text inside UITextView. I need to apply some padding to text. When i use value for top position it's working. If i use value for other position it's not working. txtt_bgImage = [UIImage imageNamed:@"txtt_bg_ipad.png"]; txtt_bgImageView = [[UIImageView alloc] initWithImage:txtt_bgImage]; txtt=[[UITextView alloc]initWithFrame:CGRectMake(170, 300, 400, 250)]; txtt.text=productDescription; [txtt setFont: [UIFont fontWithName:@"verdana" size:15]]; txtt.textColor=[UIColor whiteColor]; [txtt setBackgroundColor:[UIColor clearColor]]; txtt.contentInset = UIEdgeInsetsMake(15,0,0,0); //

How to use UIEdgeInsets property in Button in iphone

大城市里の小女人 提交于 2019-12-03 05:49:24
问题 I am new to iOS application development and wanted to know how to use UIEdgeInsets property in button so please guide me. 回答1: First off, your question isn't very clear as to what you're attempting to achieve, so...ask a general question, get a general answer. UIButton has three properties of type UIEdgeInsets – contentEdgeInsets , titleEdgeInsets , and imageEdgeInsets . You can use these properties to assign specific insets for all button content, including both the title and the image, or

UIScrollView Zooming & contentInset

痴心易碎 提交于 2019-12-03 05:02:59
问题 Simliar to iOS Photos App where the user is zooming in and out of an image by pinching: UIView > UIScrollView > UIImageView > UIImage Initially, I had the issue of zooming below scale 1: image being off centered. I got it fixed by doing this: func scrollViewDidZoom(scrollView: UIScrollView) { let offsetX = max((scrollView.bounds.width - scrollView.contentSize.width) * 0.5, 0) let offsetY = max((scrollView.bounds.height - scrollView.contentSize.height) * 0.5, 0) scrollView.contentInset =

UIScrollView Zooming & contentInset

半世苍凉 提交于 2019-12-02 20:31:06
Simliar to iOS Photos App where the user is zooming in and out of an image by pinching: UIView > UIScrollView > UIImageView > UIImage Initially, I had the issue of zooming below scale 1: image being off centered. I got it fixed by doing this: func scrollViewDidZoom(scrollView: UIScrollView) { let offsetX = max((scrollView.bounds.width - scrollView.contentSize.width) * 0.5, 0) let offsetY = max((scrollView.bounds.height - scrollView.contentSize.height) * 0.5, 0) scrollView.contentInset = UIEdgeInsetsMake(offsetY, offsetX, 0, 0) } This works well when zooming out. UIImage content mode is

Bounds automatically changes on UIScrollView with content insets

。_饼干妹妹 提交于 2019-11-30 07:23:56
I'm using a UIScrollView as my paging scroll view, pagesScrollView . Inside that, I put individual UIScrollViews which are used exclusively for zooming. Inside each of those, I have one view which is the page item which should be zoomable. All of that is inside a UINavigationController with a translucent navbar. My pagesScrollView has contentInset.top = 64 and bounds.origin.y = -64 (that seems weird to me, but that's what the system is setting automatically for me), and this works just fine. My screen looks great! However, after I scroll the pagesScrollView even a tiny bit, as soon as

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

≡放荡痞女 提交于 2019-11-30 05:13:24
I'm trying to use UIEdgeInsetsMake to make set the background of my cell to a gradient. I've tried multiple things to get it to work, but no matter what I use, there's always an issue. I simply have two static cells, where I'm trying to set their backgroundView in willDisplayCell: . I have separate images for the top, bottom and middle cells, but since I have two cells I only need the top and the bottom. These are those images: Top Bottom There's a missing line on the top of the bottom one so that there's not a 2pt line in between them. I adjusted the height of the bottom one slightly to

How to set content inset for UITextView in ios

空扰寡人 提交于 2019-11-29 00:58:23
I'm having a UITextView and set content inset as [atextView setContentInset:UIEdgeInsetsMake(0, 10, 0, 0)]; This code working in iOS 6.1 and below, but nothing happens in iOS 7.0. Muruganandham K got answer: [atextView setTextContainerInset:UIEdgeInsetsMake(7, 7, 0, 0)]; fixed my problem. And in Swift... @IBOutlet var tv:UITextView! override func awakeFromNib() { super.awakeFromNib() tv.textContainerInset = UIEdgeInsets(top: 0, left: 0, bottom: 0, right: 0) } UPDATE: another option to do that. UIView *spacerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 10, 10)]; [msgtext