ios - 自定义titleView的时候不能居中
怪我咯
怪我咯 2017-04-17 17:45:02
0
3
308

navigationBar上面添加自定义leftBarbuttonItem和rightBarbuttonItem,自定义titleView的时候不能居中,根据leftBarbuttonItem的位置计算titleView的宽度和x还是位置还是不能居中,求大神解答

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all (3)
左手右手慢动作

By default, set leftBarbuttonItem and rightBarbuttonItem, then set titleView, titleView is centered. If possible, you can send a screenshot of the code to help you find the problem.

    大家讲道理
    估计是你计算错了吧
      阿神

      I encountered the same problem. After searching everywhere, there was no answer. Finally, I tried it out with code.

      How to say:
      I added the following code after setting the custom titleView after ViewDidLoad:
      [self.navigationItem.titleView layoutIfNeeded];

        Latest Downloads
        More>
        Web Effects
        Website Source Code
        Website Materials
        Front End Template
        About us Disclaimer Sitemap
        php.cn:Public welfare online PHP training,Help PHP learners grow quickly!