ScrollView滑到 代码段

来源:互联网 发布:linux存储服务器 编辑:程序博客网 时间:2024/05/16 11:26

 [self.logString appendFormat:@"%i - %@\n", self.index, bunchOfWords];

    

    [self.logTextViewsetText:self.logString];

    

    NSLog(@"%i - %@\r",self.index, bunchOfWords);

    

    CGFloat height, offset;

    height = self.logTextView.contentSize.height -self.logTextView.bounds.size.height;

    

    offset = self.logTextView.contentOffset.y;

    NSLog(@"height:%.f offset:%f.",height,offset);

    

    if (height == offset) {

        self.dragging =NO;

    }

    //

    if (!self.isDragging) {


        CGPoint p = [self.logTextViewcontentOffset];

        NSLog(@"%@",NSStringFromCGPoint(p));

        [self.logTextViewsetContentOffset:p animated:NO];

        [self.logTextViewscrollRangeToVisible:NSMakeRange([self.logTextView.textlength], 0)];

        [self.logTextViewsetScrollEnabled:NO];

        [self.logTextViewsetScrollEnabled:YES];

    

    }

0 0