开发者

iPhone basic sheet programming?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜