在iOS 5和iOS 9的iPod 5 / iPad中运行以下代码,输出如下
UITextPosition *beginning = textView.beginningOfDocument;
UITextPosition *start = [textView positionFromPosition:beginning offset:range.location];
UITextPosition *end = [textView positionFromPosition:start offset:range.length];
UITextRange *textRange = [textView textRangeFromPosition:start toPosition:end];
CGRect rect = [textView firstRectForRange:textRange];
rect.size.width = rect.size.width + 2;
rect.origin.x = rect.origin.x - 1;
return [textView convertRect:rect fromView:textView.textInputView];
Intent.EXTRA_STREAM, image i want to send);
CGRect rect = [textView firstRectForRange:textRange]; //问题
iOS 8输出:{x = 0,y = 201,宽度= 50,高度= 19}
iOS 9输出:{x = 0,y = 293,宽度= 50,高度= 19.4}
在iOS 9中更改了坐标和高度
UITextView中有任何变化吗?