代码如下:
UITextView *testView = [UITextView new];
testView.textContainer.lineFragmentPadding = 0;
testView.textContainerInset = UIEdgeInsetsZero;
[......]
iOS中UITextView上下左右有默认padding的解决方法
Leave a reply
代码如下:
UITextView *testView = [UITextView new];
testView.textContainer.lineFragmentPadding = 0;
testView.textContainerInset = UIEdgeInsetsZero;
[......]
转载自:http://my.oschina.net/ioslighter/blog/390880
一个已经适配了iPhone6/iPhone6Plus的项目,StoryBoard/Xib中的设计视图宽度是320,在tableView:cellForRowAtIndexPath:里打印cell.size,会发现size.width在iPhone6下是320
代码是:
NSLog(@"cell size is %@", NSStringFromCGSize(cell.contentView[......]
如果公司有多款产品A B C,有时候需要在A和B中判断C时候已经安装。
首先需要看到C的url schema,方法是:
形如:product23445343242
然后代码:
+ (BOOL)canOpenScheme:(NSString *)scheme {
NSURL * url = [NSURL URLWithStrin[......]
Content Hugging
[view setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
Compress Resistance
[view setContentCompressionResistancePriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal[......]