iOS开发之-- textview 光标起始位置偏移

使用textview的时候,会发生光标偏移的情况,其实是因为iOS7里导航栏,状态栏等有个边缘延伸的效果在。

把边缘延伸关掉就好了。代码如下

//取消iOS7的边缘延伸效果(例如导航栏,状态栏等等)
self.modalPresentationCapturesStatusBarAppearance = NO;
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
原文地址:https://www.cnblogs.com/hero11223/p/6144989.html