1
目前,我有一個UIScrollView與X UIView作爲頁面。我想知道是否有方法可以獲得UIView; s當前顯示?如何獲取UIScroll中的當前UIView?
mScroll = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
mScroll.pagingEnabled = YES;
NSInteger numberOfViews = 3;
for (int i = 0; i < numberOfViews; i++) {
CGFloat yOrigin = i * self.view.frame.size.width;
MyICalView* awesomeView=[[MyICalView alloc] initWithFrame:CGRectMake(yOrigin, 0, self.view.frame.size.width, self.view.frame.size.height)];
[mScroll addSubview:awesomeView];
[awesomeView release];
}
mScroll.contentSize = CGSizeMake(self.view.frame.size.width * numberOfViews, self.view.frame.size.height);
mScroll.delegate=self;
有什麼辦法可以讓awesomeView當前顯示的?