在所有app界面swift2中保持像页脚一样的底部视图[关闭](Maintain a bottom view like a footer in all app interface swift2 [cl

编程入门 行业动态 更新时间:2024-10-20 09:23:01
在所有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"\]) { }

显示如何设置segue标识符 显示使用页脚添加容器视图后故事板的外观

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"\]) { }

Shows how to set segue identifier Shows how storyboard looks like after adding container view with footer

更多推荐

本文发布于:2023-07-07 21:37:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1068507.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:视图   界面   像页脚   app   Maintain

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!