gpt4 book ai didi

ios - 如何使用 swift 在 subview 中添加标签栏和导航栏?

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:59:31 24 4
gpt4 key购买 nike

Please refer the image, where I have used the Navigation Bar我尝试遍地冲浪,但无法找到解决方案。另外,我是 swift 的新手,所以请帮忙!我有一个 View Controller ——登录页面,它连接到另一个 View Controller ——CoreView.swift。我在 CoreView ViewController 中创建了 5 个 subview 。我想添加一个标签栏,用户可以点击标签栏的图像,相应的 subview 应该打开。另外,帮助我将图像添加为 subview 图标。图标不显示。

此外,当我尝试从导航 Controller 放置后退按钮时,我可以设置标题和提示消息,但不能设置 subview 中的后退按钮,为什么这样?

谢谢!

Look at this image to see the code and the xib file made

我有以下变化。但仍然没有运气..

最佳答案

关于导航栏 -> 您应该能够将 UIButton 拖放到左侧栏按钮项目中:

enter image description here

编辑:更新图像以实际显示 xib 实现。

EDIT2:链接按钮使用这个:

@IBAction func buttonTapped(sender: AnyObject) {
print("Back button tapped")
}

确保将界面构建器中的按钮连接到自定义 View 。您需要有一个自定义的 UIView 子类,并且应该为您的文件所有者选择。

关于ios - 如何使用 swift 在 subview 中添加标签栏和导航栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38014725/

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