// UIScrollView
UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(100, 100, 500, 300)];
scrollView.backgroundColor = [UIColor grayColor];
// 是否接收触摸事件
scrollView.userInteractionEnabled = YES;
// 是否允许滚动
scrollView.scrollEnabled = YES;
// 设置额外的滚动响应区域
UIEdgeInsets contentInsets = UIEdgeInsetsMake(10, 10, 10, 10);
scrollView.contentInset = contentInsets;
// 隐藏滚动条
scrollView.showsHorizontalScrollIndicator = NO;
// scrollView.showsVerticalScrollIndicator = NO;
UILabel *label = [[UILabel alloc]initWithFrame:CGRectMake(100, 150, 200, 100)];
label.text = @"test";
// 设置滚动区域
scrollView.contentSize = CGSizeMake(label.frame.size.width, label.frame.size.height + 500);
[scrollView addSubview:label];
[self.view addSubview:scrollView];