Und*_*ion 94 objective-c uiviewcontroller ios ios5
有人能指出我创建自定义视图控制器作为容器视图控制器的任何好例子吗?我能找到的唯一文档是UIViewController类参考中的几个段落.我觉得我需要比这更多的信息,一个示例实现会很好.谷歌根本没有发现任何事情.
我对这个方法特别感兴趣:
transitionFromViewController:toViewController:duration:options:animations:completion:
Run Code Online (Sandbox Code Playgroud)
Jos*_*phH 37
除了WWDC会话视频会话102 - 实现已经提到的超级加密的UIViewController Containment之外,关于"iOS上视图控制器的演变"的Apple WWDC 2012会话也涵盖了这个主题,示例代码是示例代码包的一部分:
这里还有一个例子:https: //github.com/toolmanGitHub/stackedViewControllers
小智 17
- (void)viewDidLoad{
[super viewDidLoad];
// I put self in a Navigation VC so we can use its right navigationbar
// item for triggering the transition
self.navigationItem.rightBarButtonItem =
[[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemEdit
target:self
action:@selector(button:)]
autorelease];
// create test1 and test2 instance (subclass UIViewController and
// also need to define their own nibs)
vc1 = [[test1 alloc]initWithNibName:@"test1" bundle:nil];
vc2 = [[test2 alloc]initWithNibName:@"test2" bundle:nil];
//add to the container vc which is self
[self addChildViewController:vc1];
[self addChildViewController:vc2];
//the entry view (will be removed from it superview later by the api)
[self.view addSubview:vc1.view];
}
Run Code Online (Sandbox Code Playgroud)
这个IBAction触发了两个VC之间的过渡:
-(IBAction)button:(id)sender {
[self transitionFromViewController:vc1
toViewController:vc2
duration:0.5
options:UIViewAnimationOptionTransitionCurlDown
animations:nil
completion:nil];
}
Run Code Online (Sandbox Code Playgroud)
Yur*_*kin 11
我发现这个例子对我非常有用
http://sandmoose.com/post/35714028270/storyboards-with-custom-container-view-controllers
他们在github上有源代码:
https://github.com/mluton/EmbeddedSwapping
Rui*_*res 10
可以这样:
http://subjective-objective-c.blogspot.com/2011/08/writing-high-quality-view-controller.html
足够满足您的需求?
不知道这是否是一个"好"的例子,但你可以从https://bitbucket.org/javieralonso/jaacordeonviewcontroller/overview获得一个免费的Container ViewController
这是一个完整的手风琴隐喻容器视图控制器
| 归档时间: |
|
| 查看次数: |
91617 次 |
| 最近记录: |