gpt4 book ai didi

ios - 如何为应用程序的每个 ViewController 添加页脚?

转载 作者:行者123 更新时间:2023-11-28 08:04:20 24 4
gpt4 key购买 nike

我是 iPhone 开发的初学者。

我用 SWRevealViewController 添加了侧边菜单。

Github SWRevealViewController

这是我的侧边菜单代码

func sideMenus(){
if revealViewController() != nil {
menuButton.target = revealViewController()
menuButton.action = #selector(SWRevealViewController.revealToggle(_:))
revealViewController().rearViewRevealWidth = 250
revealViewController().rightViewRevealWidth = 160
view.addGestureRecognizer(self.revealViewController().panGestureRecognizer())
}
}

但我现在卡住了。我现在正在努力为应用程序添加页脚。

我不想使用标签栏 Controller 。因为我在页脚中只有一张图片。你们能帮我把页脚添加到我的应用程序吗?

谢谢

最佳答案

您需要为每个 ViewController 添加一个显示页脚的 UI 元素。您的设计最简单的选择似乎是 UIImageView 并将代表您的赞助商文本+图像的图像加载到它。

另一种解决方案是将 UIToolBarUITabBar 添加到每个没有按钮的 ViewController 并将图像设置为背景图像你的标签栏到工具栏。您可以在 Storyboard 或代码中执行此操作。

关于ios - 如何为应用程序的每个 ViewController 添加页脚?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45606229/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com