阅读背景:

Textview Center文本对齐方式ios7

来源:互联网 
-(void)observeValueForKeyPath:(NSString *)keyPath   ofObject:(id)object   change:(NSDictionary *)change   context:(void *)context 
{
    NSLog(@"Hello");
    UITextView *tv = object;
    CGFloat topCorrect = ([tv bounds].size.height - [tv contentSize].height * [tv zoomScale])  / 2.0;
    topCorrect = ( topCorrect < 0.0 ? 0.0 : topCorrect );
    tv.contentOffset = (CGPoint){.x = 0, .y = -topCorrect};
}
-(void)observeValueForKeyPath:(NSString *)keyPa



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: