Ios UITextView在分页UIScrollView中滚动不工作

Ios UITextView在分页UIScrollView中滚动不工作,ios,objective-c,uiscrollview,uitextview,Ios,Objective C,Uiscrollview,Uitextview,所以基本上我有一个UIScrollView,在它里面我有一个UIView作为内容视图滚动视图页面设置为启用,在内容视图里面我有一个UIImage视图在顶部,在它下面我有一个UITextView,文本视图可以有比它自己的高度更大的文本,所以它应该滚动 这是我的密码 -(void)setUpMainScroller{ if(MainScroller != nil) { [[self.MainScrollViewContainer viewWithTag:80] removeFrom

所以基本上我有一个UIScrollView,在它里面我有一个UIView作为内容视图滚动视图页面设置为启用,在内容视图里面我有一个UIImage视图在顶部,在它下面我有一个UITextView,文本视图可以有比它自己的高度更大的文本,所以它应该滚动 这是我的密码

-(void)setUpMainScroller{     
if(MainScroller != nil)
{
    [[self.MainScrollViewContainer viewWithTag:80] removeFromSuperview] ;
}

MainScroller = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.MainScrollViewContainer.frame.size.height)];
MainScroller.tag = 80 ;
MainScroller.backgroundColor = [UIColor clearColor] ;
MainScroller.showsHorizontalScrollIndicator = NO;
MainScroller.delegate = self ;
MainScroller.pagingEnabled = YES ;
MainScroller.clipsToBounds = YES;
MainScroller.delaysContentTouches = NO;
CGFloat paperWidth = MainScroller.frame.size.width;
NSDictionary * item = [elements objectAtIndex:selectedIndex] ;
NSArray * temp = item[@"Sub"] ;
NSUInteger numberOfPapers = [temp count];
count = (int)numberOfPapers ;
CGFloat por =( self.view.frame.size.width-40)/(CGFloat)numberOfPapers;
[self setupIndicatorWithPaperWidth:por andPaperCount:(int)numberOfPapers] ;


for (NSUInteger i = 0; i < numberOfPapers; i++) {
    CGFloat rest = self.MainScrollViewContainer.frame.size.height ;
    CGFloat labl =rest - 140+15 ;
    CGFloat contentheight = 140+15 + rest ;
    UIView * content = [[UIView alloc] initWithFrame:CGRectMake(paperWidth*i, 0, self.view.frame.size.width, contentheight)] ;
    content.clipsToBounds = YES ;

        UIImageView * image = [[UIImageView alloc] initWithFrame:CGRectMake(20, 0, paperWidth-40, 140)];

        image.backgroundColor = [UIColor grayColor] ;
    if(i == 0 )
        image.backgroundColor = [UIColor redColor] ;
    else if (i==1)
        image.backgroundColor = [UIColor blueColor] ;
    else if(i ==2)
        image.backgroundColor = [UIColor greenColor] ;
    CGFloat imageheight  = image.frame.size.height +15 ;
    CGFloat labelheight = contentheight - imageheight ;


    UITextView * textview= [[UITextView alloc] initWithFrame:CGRectMake( 20 ,image.frame.origin.y + image.frame.size.height +15, paperWidth - 40 , 20)] ;
    [textview setBackgroundColor:[UIColor grayColor]] ;

    [textview setText:label.text];
    [textview setUserInteractionEnabled:YES] ;
    textview.delegate = self ;
    textview.contentSize = CGSizeMake(textview.bounds.size.width , textview.bounds.size.height+50) ;

    [content addSubview:image] ;  

    [content addSubview:@"LONG TEXT"] ;



    [MainScroller addSubview:content] ;

    //[content bringSubviewToFront:textview] ;

    [textview setScrollEnabled:YES];

          //  [MainScroller addSubview:image];


}
CGSize contentSize = CGSizeMake(paperWidth * numberOfPapers, MainScroller.bounds.size.height);
MainScroller.contentSize = contentSize;

[self.MainScrollViewContainer addSubview:MainScroller];

self.MainScrollViewContainer.scrollview =MainScroller ;
[self.MainScrollViewContainer bringSubviewToFront:MainScroller];}}
-(无效)setUpMainScroller{
如果(主滚动条!=nil)
{
[[self.mainScrollViewContainerViewWithTag:80]从SuperView移除];
}
MainScroller=[[UIScrollView alloc]initWithFrame:CGRectMake(0,0,self.view.frame.size.width,self.MainScrollViewContainer.frame.size.height)];
MainScroller.tag=80;
MainScroller.backgroundColor=[UIColor clearColor];
MainScroller.showsHorizontalScrollIndicator=否;
MainScroller.delegate=self;
MainScroller.PaginEnabled=是;
MainScroller.clipsToBounds=是;
MainScroller.delaysContentTouches=否;
CGFloat paperWidth=main scroller.frame.size.width;
NSDictionary*项=[元素对象索引:selectedIndex];
NSArray*temp=项目[@“子”];
NSU整数张数=[temp count];
计数=(int)论文数;
CGFloat-por=(self.view.frame.size.width-40)/(CGFloat)张数;
[带纸张宽度的自设置指示器:por和纸张计数:(int)纸张数];
对于(i=0;i
我可以通过删除主滚动视图的任何容器视图来修复此问题