首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

UIScrollView 事例

2012-10-05 
UIScrollView 例子?CGRect wholeWindow CGRectMake(0.0, 0.0, self.view.frame.size.width, self.view.f

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];

热点排行