2012-09-27 248 views
0

我試圖實現的是:
當UISlider滾動時,小幫手視圖應該在顯示當前滑塊值時淡出。當滑塊釋放時,輔助視圖淡出。什麼是最簡單的方法來做到這一點?在iOS中顯示彈出窗口

回答

3

喜隊友只是看到這個例子的代碼,並使用這個類在iphone顯示popupview ..

http://blog.chrismiles.info/2010/12/cmpoptipview-custom-popup-view-for-ios.html

我希望這會幫助你..

:)

編輯:

-(void)addPopUpView{ 


    Yourview.transform = CGAffineTransformMakeScale(1.3, 1.3); 
    objMakeOfferView.view.alpha = 0; 
    [UIView animateWithDuration:.35 animations:^{ 
     Yourview.alpha = 0.94; 
     Yourview.transform = CGAffineTransformMakeScale(1, 1); 
    }]; 
    objMakeOfferView.view.frame=CGRectMake(0, 0, 120, 80);///set frame which you required 
    [self.view addSubview:Yourview]; 


} 
-(void)removePopUpView{ 
    [UIView animateWithDuration:.35 animations:^{ 
     Yourview.transform = CGAffineTransformMakeScale(1.3, 1.3); 
     Yourview.alpha = 0.0; 
    } completion:^(BOOL finished) { 
     [Yourview removeFromSuperview]; 
    }]; 


} 

也使用你想要的不同類型的TransitionAnimation ..

:)