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.
精彩评论