简体   繁体   English

如何在导航栏下方无缝添加UIButton?

[英]How can I add UIButton right underneath navigation bar seamlessly?

I am adding a button in the centre and right underneath my navigation bar. 我在导航栏的中央和右侧添加了一个按钮。 Problem here is that the navigation bar will look like it's cutting off due to its shadow & tint. 这里的问题是,由于其阴影和色调,导航栏看起来像被切断了。

How can I incorporate the UIButton so that it looks like it's a part of the navigation bar like this: 如何合并UIButton,使其看起来像是导航栏的一部分,如下所示:

____navbar _______   
    l_____|

If I just add a UIButton right underneath the nav bar, it will just look like this: 如果我只是在导航栏下方添加一个UIButton,它将看起来像这样:

__________________
     l______|

The button will be used to drag or drop down another uiviewcontroller. 该按钮将用于拖放其他uiviewcontroller。

What you need to do is to remove the 1px line that acts as the border or shadow for the UINavigationBar . 您需要做的是删除充当UINavigationBar的边框或阴影的1px线。 You can find the way of doing that in the answer here: 您可以在以下答案中找到实现此目的的方法:

https://stackoverflow.com/a/19227158/569507 https://stackoverflow.com/a/19227158/569507

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM