2012-08-14 34 views
0

IVe在幾個蘋果應用程序中注意到,當您單擊文本框或標籤時,uipicker會加載,然後當您做出選擇時它會消失。我基本上試圖重新創建。但有一點困難。想知道是否有人有任何這樣的教程的鏈接,或者可以提供關於如何重新創建相同的想法。從uipicker製作組合框

謝謝

+0

您的問題在這裏回答。 http://stackoverflow.com/questions/6699392/popup-uipicker-when-tapping-on-uitextfield – iNeal 2012-08-14 17:07:09

回答

0

選擇器只是一個UIView,作爲要與

[UIView animateWithDuration:duration animation:^{ 
     //custom animation you need. For example show from the bottom. Of course, you need to set the origin frame of picker to somewhere under the screen. 
     myPicker.frame = CGRectMake(0, self.view.bounds.height.y - myPicker.frame.size.height, myPicker.frame.size.width, myPicker.frame.size.height); 
}]; 

它可以從底部或進/出衰落被彈出,你可以做任何類型的動畫。任何東西。然後你可以使用相反的動畫來解除它。