簡體   English   中英

iPhone上從下到上打開帶有幻燈片效果的視圖

[英]Open view with slide effect from bottom to top on iPhone

我正在為iPhone(以橫向模式運行)(OS 3.0)制作應用程序,我希望當我觸摸工具欄按鈕時,它會打開一個帶有幻燈片效果的視圖(類似於觸摸'書簽'時的效果Mobile Safari的工具欄)從屏幕的底部到頂部。 該視圖與按鈕位於同一XIB文件中。

我怎樣才能做到這一點?

提前致謝。

如果你問的是做動畫自定義,這里有一個可能有幫助的片段。 讓我們假設視圖“myView”已經作為子視圖添加到當前視圖中。

[myView setFrame:CGRectMake(0, 480, 320, 480)];
[myView setBounds:CGRectMake(0, 0, 320, 480)];

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelegate:self];
[myView setFrame:CGRectMake(0, 0, 320, 480)];
[UIView commitAnimations];

其中的重要數字是setFrame rect中的y位置(480然后是0),這會將其從屏幕外移動到屏幕上。

[self.tabBarController presentModalViewController:yourSlideController animated:YES];

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM