if(IOS7_And_Later)
{
self.automaticallyAdjustsScrollVieWinsets
= NO;
}
-
(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);
}
}
}
【UITextView輸出中文時,在輸出多行後,光標有時會上下跳動】的相關資料介紹到這裡,希望對您有所幫助! 提示:不會對讀者因本文所帶來的任何損失負責。如果您支持就請把本站添加至收藏夾哦!