123 | if (IOS7_And_Later) { self .automaticallyAdjustsScrollViewInsets = NO ; } |
123456789101112 | - ( void )textViewDidChangeSelection:(UITextView *)textView { //fix ios7 bug (modified by 老岳). if (floor( NSFoundationVersionNumber ) > NSFoundationVersionNumber_iOS_6_1 ) { CGRect r = [textView caretRectForPosition:textView.selectedTextRange. end ]; CGFloat caretY = MAX(r.origin.y - textView.frame.size.height + r.size.height + 8, 0); if (textView.contentOffset.y < caretY && r.origin.y != INFINITY) { textView.contentOffset = CGPointMake(0, caretY); } } } |
新闻热点
疑难解答