UIScrollView cannot see ScrollBars/Indicators.

前端 未结 2 1397
遥遥无期
遥遥无期 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.

提交回复
热议问题