UIScrollView

UIScrollView无法滚动的解决方法

  • 没有设置contentSize
  • scrollEnabled = NO
  • 没有接收到触摸事件:userInteractionEnabled = NO

UIScrollView 常见属性
@property(nonatomic) CGPoint contentOffset
用来表示滚动的位置,其实就是内容左上角与scrollview左上角的间距值,其实就是偏移量

@property(nonatomic) CGSize contentSize
用来表示UIScrollView内容的尺寸,滚动范围

@property(nonatomic) UIEdgeInsets contentInset
能够在UIScrollView的4周增加额外的滚动区域,一般用来避免scrollView的内容被其他空间挡住

@property(nonatomic)BOOL bounces;
用来控制是否需要弹簧效果

@property(nonatomic)BOOL scrollEnabled
决定scrollview能够滚动

你可能感兴趣的:(UIScrollView)