Scroll View not functioning IOS 7

前端 未结 2 741
慢半拍i
慢半拍i 2020-12-02 07:13

I have a scrollview inside which i have 20 UItextviews. The scrollview is not working. I have set the following in viewdidload.

self.MainScroll.contentSize =          


        
2条回答
  •  庸人自扰
    2020-12-02 07:31

    Update the content size after some delay as below.

    - (void)viewDidLayoutSubviews {
        [self performSelector:@selector(updateContentSize)
                   withObject:nil
                   afterDelay:0.25];
    
    }
    
    -(void)updateContentSize{
        UIView *viewLast = [viewContent viewWithTag:100];
        scrollViewAd.contentSize = CGSizeMake([UIScreen mainScreen].bounds.size.width, CGRectGetMaxY(viewLast.frame));
    }
    

提交回复
热议问题