Skip to content

Instantly share code, notes, and snippets.

@lqik2004
lqik2004 / gist:3155956
Created July 21, 2012 14:30
设置UITextView Padding
//设置padding
-(void) padding{
//padding大小(top,left,bottom,right)
UIEdgeInsets padding = UIEdgeInsetsMake(0, 15, 0, 15);
_textView.contentInset = padding;
CGRect frame = _textView.frame;
// must change frame before bounds because the text wrap is reformatted based on frame, don't include the top and bottom insets
CGRect insetFrame = UIEdgeInsetsInsetRect(frame, UIEdgeInsetsMake(0, padding.left, 0, padding.right));
originTextArray=[NSMutableArray arrayWithCapacity:0];
transTextArray=[NSMutableArray arrayWithCapacity:0];
NSString *rex=@"<[^>]*?>([^<]*)";
NSArray *r=[self.item.summary arrayOfCaptureComponentsMatchedByRegex:rex];
BOOL judge=YES;
for(NSArray *tmp in r){
NSString *content=[tmp objectAtIndex:1];
//过滤连续标签中间的空内容