uiedgeinsets

UITextView contentInset not working in UITextView on iOS 7?

戏子无情 提交于 2020-01-24 03:57:46
问题 I'm trying to set a UITextView 's contentInset property. When doing so, the UIEdgeInset 's top variable works just fine. So [self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)]; works. But assigning any other variable of UIEdgeInsets doesn't work. Only the top adjusts. bottom doesn't adjust, neither do left or right . So [self.textView setContentInset: UIEdgeInsetsMake(0, 50, 100, 50)]; doesn't do anything to my textView. Am I missing something? Any ideas? 回答1: Use

UITextView contentInset not working in UITextView on iOS 7?

↘锁芯ラ 提交于 2020-01-24 03:57:01
问题 I'm trying to set a UITextView 's contentInset property. When doing so, the UIEdgeInset 's top variable works just fine. So [self.textView setContentInset: 'UIEdgeInsetsMake(50, 0, 0, 0)]; works. But assigning any other variable of UIEdgeInsets doesn't work. Only the top adjusts. bottom doesn't adjust, neither do left or right . So [self.textView setContentInset: UIEdgeInsetsMake(0, 50, 100, 50)]; doesn't do anything to my textView. Am I missing something? Any ideas? 回答1: Use

How to change tintColor of image in UIButton with imageEdgeInsets?

倾然丶 夕夏残阳落幕 提交于 2020-01-21 19:14:24
问题 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 = UIEdgeInsetsMake(0, -insetAmount, 0, insetAmount); self.titleEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, -insetAmount); self.contentEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, insetAmount); } And then I add the image with this code: [self.myButton setImage:[UIImage

How to change tintColor of image in UIButton with imageEdgeInsets?

人盡茶涼 提交于 2020-01-21 19:14:05
问题 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 = UIEdgeInsetsMake(0, -insetAmount, 0, insetAmount); self.titleEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, -insetAmount); self.contentEdgeInsets = UIEdgeInsetsMake(0, insetAmount, 0, insetAmount); } And then I add the image with this code: [self.myButton setImage:[UIImage

Bounds automatically changes on UIScrollView with content insets

ⅰ亾dé卋堺 提交于 2019-12-30 02:19:06
问题 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.

iOS 7 - UITextView clipping text

冷暖自知 提交于 2019-12-23 03:51:48
问题 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 textviews shown below have the same font, text, and edge insets. Line 3 does not appear in iOS 7. 回答1: I had success using [_messageField setTextContainerInset:UIEdgeInsetsMake(0, 0, 0, 0)]; and adjusting as needed. 回答2: This solved the issue I was having.

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

时光毁灭记忆、已成空白 提交于 2019-12-18 11:57:30
问题 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

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

随声附和 提交于 2019-12-18 11:57:12
问题 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

Text padding on UILabel

拥有回忆 提交于 2019-12-12 10:00:20
问题 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

UICollectionView Bounds Width is always 600

依然范特西╮ 提交于 2019-12-12 05:28:09
问题 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 TableViewCell . contentView . Now i want to set the UICollectionView section insect. In this method - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section when