5

I have a problem since I updated to iOS7.

I have base UIScrollView horizontally and there is UITableView on it (looks like a navigation style). And I addChild UITextView on UITableView not on the cells.

And it scrolled to UITextView's cursor when typing keyboard. And it works greatly until iOS 6 but not since updating iOS7.

How can I solve this problem?

Thanks.

4

2 回答 2

6

textViewDidChangeSelectionUITextViewDelegate 中的句柄:

- (void)textViewDidChangeSelection:(UITextView *)textView {
    [textView scrollRangeToVisible:textView.selectedRange];
}

确切的解决方案取决于您的应用程序,您可以通过子类化 UITextView 来处理,但我更喜欢这里的装饰器模式(在 UITextViewDelegate 协议上)。

我希望它有所帮助。

于 2013-11-09T18:39:51.420 回答
0

您是否在 xCode4 中创建了 XIB,现在尝试在 xCode5 中打开它?如果是,请正确检查您的 XIB,因为 Xcode5 更新较旧的 xCode 4.x XIB,有时会导致无法预测的输出。当我的所有视图在 Xcode5 中打开后消失时,我面临同样的问题。

还请尝试更改 File Inspector 中的 xib 设置以在 xcode 4.x 中打开并以 ios6.1 及更早版本查看,看看它是否有任何改变..

于 2013-11-14T13:10:18.867 回答