UIScrollView cannot see ScrollBars/Indicators.

前端 未结 2 1361
遥遥无期
遥遥无期 2021-01-19 03:42

I programatically created a UISCrollView but i cant see the scrollbars/indicators.

UIScrollView * contentScrollView = [[UIScrollView alloc]initWithFrame:CGR         


        
相关标签:
2条回答
  • 2021-01-19 04:09

    For the scroll view to scroll, the content size for the scroll view must be greater than its bounds. Please add this line and then check:

    contentScrollView.contentSize=CGSizeMake(320, 250);
    

    and also set the contentScrollView.bounces to YES and remove the line contentScrollView.showsVerticalScrollIndicator=YES as you have first set the value to NO and then YES.

    This should do the job.

    0 讨论(0)
  • 2021-01-19 04:21
    contentScrollView.showsHorizontalScrollIndicator = YES;
    contentScrollView.showsVerticalScrollIndicator = YES;
    
    0 讨论(0)
提交回复
热议问题