gpt4 book ai didi

uinavigationbar - 如何去除 UINavigationBar 和 UISearchBar 细线

转载 作者:行者123 更新时间:2023-12-03 18:08:11 30 4
gpt4 key购买 nike

我正在创建一个 iOS 7 应用程序,其中我希望在 NavigationBar 下方有一个 SearchBar,我希望它们看起来像一个整体。因此,我需要用相同的颜色(已经完成)为它们着色,并删除 NavigationBar 底部和 SearchBar 顶部的细线。我怎样才能做到这一点?

最佳答案

正式地说,这只能通过设置 shadowImage 来实现。导航栏到一个空图像。但是,仔细查看文档,它说:

For a custom shadow image to be shown, a custom background image must also be set with the setBackgroundImage:forBarMetrics: method. If the default background image is used, then the default shadow image will be used regardless of the value of this property.



通过使用自定义背景图像,您将失去模糊的背景半透明度。

如果你喜欢冒险,“发际线”是一个 UIImageView,它是导航栏的 subview 。您可以找到它并将其设置为隐藏。例如,这就是 Apple 在其原生日历应用程序中所做的。请记住在当前 View 消失时显示它。

关于uinavigationbar - 如何去除 UINavigationBar 和 UISearchBar 细线,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19037464/

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