2012-10-06 54 views

回答

0

使用滾動型方法

- (void)scrollViewDidScroll:(UIScrollView *)scrollView 
{ 
    CGPoint offset = scrollView.contentOffset; 
    CGRect bounds = scrollView.bounds; 
    CGSize size = scrollView.contentSize; 
    UIEdgeInsets inset = scrollView.contentInset; 
    float y = offset.y + bounds.size.height - inset.bottom; 
    float h = size.height; 

    if(scrollView.contentOffset.y < 0.0f && scrollView.contentOffset.y > -80.0f) 
    { 
     // 
     display your image at this point 
     NSLog(@"\n pos: %f of %f", y, h); 
    } 
0

你可以做到這一點很容易:

的UIScrollView滾動視圖* = [[UIScrollView的頁頭] initWithFrame:方法CGRectMake(0,0,320,1000)]; [self.view addSubview:scrollView];這個會添加一個scrollView :) UIImageView * imgView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,HEIGHTYOUWANT)]; imgView.image = [UIImage imageName:@「band.png」]; [scrollView addSubview:imgView];

這將增加你的樂隊,其中有在你的Projectfolder在滾動型的頂部,因此,如果您向下滾動的圖片,圖片去與它:)

創建一個UINavigationBar的HERE

[self.view addSubview:navigationBar];

// ^它必須是self.view不滾動視圖,否則導航欄移動得

相關問題