How to make UINavigationBar Transparent in IOS 8?

后端 未结 6 1239
醉话见心
醉话见心 2021-01-05 14:09

I have tried a lot to make UINavigationBar transparent. But I failed making it so.The image which I set was transparent. Here is my code . Any help ? Thanks in advance.

6条回答
  •  离开以前
    2021-01-05 14:46

    Thanks all. The thing is that I am adding this line in my view controller:

    if (IS_OS_7_OR_LATER)
    {
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.automaticallyAdjustsScrollViewInsets = NO;
    }
    

    that is why the code is not working. When I remove the line

    self.edgesForExtendedLayout = UIRectEdgeNone;
    

    the code works.

提交回复
热议问题