`

UIScrollView 例子

 
阅读更多

 

	CGRect wholeWindow = CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.frame.size.height);
	UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:wholeWindow];
	[self.view addSubview:scrollView];
	[scrollView release];
	CGRect reallyBigRect;
	reallyBigRect.origin = CGPointZero;
	reallyBigRect.size.width = wholeWindow.size.width * 1.2;
	reallyBigRect.size.height = wholeWindow.size.height * 2.0;
	[scrollView setContentSize:reallyBigRect.size];
	
	CGPoint offset;
	offset.x = 0.0;
	offset.y = 0.0;
	[scrollView setContentOffset:offset];
	
	[scrollView setMinimumZoomScale:0.5];
	[scrollView setMaximumZoomScale:5];
	[scrollView setDelegate:self];
	
	summaryView = [[ProjectSummaryView alloc]  initWithFrame:reallyBigRect];
	
	[summaryView setBackgroundColor:[UIColor clearColor]];
	[scrollView addSubview:summaryView];
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics