在所有app界面swift2中保持像页脚一样的底部视图[关闭](Maintain a bottom view like a footer in all app interface swift2 [closed])
对不起我的英语不好。 我是iOS的新手,我想知道如何创建视图控制器并将其修复在应用程序中每个界面的页脚中。 视图是某种媒体控制器。 在此处输入图像描述
Sorry for my English. I'm new with iOS and I wonder how to create view controller and fixed it in the footer of every interface in the app. The view is some kind of a media controller. enter image description here
最满意答案
使用故事板,从窗口小部件库中拖动控制器并执行以下步骤。
在控制器视图的底部添加视图,然后自定义所需的格式。 从窗口小部件库中拖动ContainerView并将其添加到底部视图的正上方(在步骤1中添加) 现在,根据应用程序的需要定义多个控制器。 将segue标识符设置为每个控制器segue。在根控制器中使用以下代码
[-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if(\[segue.identifier isEqualToString:@"controller1"\]) { } else if (\[segue.identifier isEqualToString:@"controller2"\]) { }
Using storyboard, drag a controller from widgets library and do the following steps.
Add a view at the bottom of the controller view and customise however the format you want. Drag a ContainerView from the widgets library and add it just above the bottom view (added in step 1) Now define as many controllers as your application requires. Set segue identifiers to each and every controllers segue.Use following code to in your root controller
[-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if(\[segue.identifier isEqualToString:@"controller1"\]) { } else if (\[segue.identifier isEqualToString:@"controller2"\]) { }
更多推荐
发布评论