I've added a UIPageControl
to the titleView
in the navigationItem
, but the issue is that it is not centered due to I only have a leftBarButton
. Is it possible to create a rightBarButtonItem
which is hidden so the UIPageControl
is centered?
Asked
Active
Viewed 1,058 times
2

Haroldo Gondim
- 7,725
- 9
- 43
- 62

gamerChristian
- 471
- 2
- 6
- 17
-
Yes you can create a right bar button and hide it. But titleView is centered by default. So are you saying that it is not centered in the remaining space left by the one other button or that it is not the center of the bar? – Konsol Labapen Sep 23 '14 at 16:16
-
it is centered in the remaining space left by the leftBarButton – gamerChristian Sep 23 '14 at 16:29
-
it's not centered if the leftBarButtonItem isn't the same size as rightBarButtonItem – Oren Dec 12 '14 at 04:08
-
Possible duplicate of [center custom title in UINavigationBar?](http://stackoverflow.com/questions/9921026/center-custom-title-in-uinavigationbar) – jrc Nov 07 '15 at 13:03