开发者

iPhone basic sheet programming?

开发者 https://www.devze.com 2022-12-23 21:19 出处:网络
I want to program an \"Add\"-Window to my a开发者_运维知识库pplication, much like the \"Add Contact\"-window in the Contacts app or the \"Add City\"-window in the Weather app.

I want to program an "Add"-Window to my a开发者_运维知识库pplication, much like the "Add Contact"-window in the Contacts app or the "Add City"-window in the Weather app.

My question is: how do I code the effect of sliding up that Contacts & Weather feature?

-- Ry


These are called "modal view controllers".

You create a view controller for that "sheet", and from any method of another view controller call

sheetViewController = [[SheetViewController alloc] init…]
[self presentModalViewController:sheetViewController animated:YES];

to slide up the sheet, and from any method of the sheet view controller call

[self dismissModalViewControllerAnimated:YES];

to slide down. Search the term "Modal View Controllers" in the Xcode docs for detail.

0

精彩评论

暂无评论...
验证码 换一张
取 消