Swift 3-如何在标签栏上创建醒目的按钮(例如相机按钮) [英] Swift 3 - How do I create a prominent button on a tab bar (e.g. camera button)

查看:81
本文介绍了Swift 3-如何在标签栏上创建醒目的按钮(例如相机按钮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Swift 3,Xcode 8.2.

I am using Swift 3, Xcode 8.2.

我想要这样的事情(忽略以奥斯卡为主题的填充),其中标签栏上的摄像头按钮更加突出/环绕:

I want to something like this (ignore the Oscars-themed fill) where the camera button is a bit more prominent/encircled on the tab bar:

我认为整个事情都是一幅图像,但是该图像是否自然地以某种方式从选项卡栏上抬起了呢?

I assume the whole thing is an image but is that image just naturally raised off the tab bar in some way?

任何资源,或者如果您能将我指出正确的方向,那就太好了.谢谢!

Any resources or if you can point me in the right direction would be great. Thank you!

编辑

我可能已经找到另一篇文章,解释了我想做的事情:

I may have found another article that explains what I want to do: How do we create a bigger center UITabBar Item

推荐答案

一种方法是使用虚拟中心视图控制器将UIButton轻松添加到UITabBarController顶部.

One way is to simply add your UIButton on top of UITabBarController with the dummy center view controller.

在这里,我使用情节提要和子类UITabBarController添加该按钮:

Here I use storyboard and subclass UITabBarController to add that button:

这是我的故事板,请注意中心视图控制器是如何放置空间的:

This is my storyboard, note how the center view controller is just there for space:

只有这些代码和情节提要,这就是结果:

With only those code and storyboard, this is the result:

此处的项目: https://github.com/aunnnn/TestButtonOnTabBar/

这篇关于Swift 3-如何在标签栏上创建醒目的按钮(例如相机按钮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆