UIView背景图固定不滚动实现

 

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
		self.title = @"比分";
		UIBarButtonItem *reloadItem = [[UIBarButtonItem alloc] initWithTitle:@"重新加载" style:UIBarButtonItemStylePlain target:self action:@selector(reloadItem_click:)];	
		self.navigationItem.rightBarButtonItem = reloadItem;
		self.back = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"back.png"]];
		self.back.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
		[self.view addSubview:self.back];
		self.mainView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
		self.mainView.backgroundColor = [UIColor clearColor];
		[self.view addSubview:self.mainView];
    }
    return self;
}
 

UIView背景图固定不滚动实现