UIKIT_STATIC_INLINE UIEdgeInsets UIEdgeInsetsMake(CGFloat top,CGFloat left, CGFloat bottom,CGFloat right)
{
UIEdgeInsets insets = {top, left, bottom, right};
return insets;
}
ios7下新增了一个属性textContainerInset,
_contentTextView.textContainerInset = UIEdgeInsetsMake(10, 10, 0, 10);//设置页边距
上边距10,左右边距各10,底边距0
_contentTextView = [[UITextViewalloc]initWithFrame:CGRectMake(0,74,DEVICEWIDTH,90)];
_contentTextView.backgroundColor = [UIColorwhiteColor];
_contentTextView.delegate =self;
_contentTextView.font =TextFont;
_contentTextView.textColor = [UtilcolorWithHexString:@"999999"];
_contentTextView.textContainerInset =UIEdgeInsetsMake(10,10,0,10);//设置页边距
[self.viewaddSubview:_contentTextView];
效果图如下: