ios - add button navigationbar center -


it easy add left , right buttonbaritem on navigationbar

but hope add button navigationbar center

my code

 [self.navigationitem.titleview addsubview:button ];//button not nil 

but nothing happens

yourc comment welcome

the titleview nil default code doesn't anything.

change code to:

self.navigationitem.titleview = button; 

this sets button titleview.


Comments

Popular posts from this blog

javascript - gulp-nodemon - nodejs restart after file change - Error: listen EADDRINUSE events.js:85 -

Fatal Python error: Py_Initialize: unable to load the file system codec. ImportError: No module named 'encodings' -

javascript - oscilloscope of speaker input stops rendering after a few seconds -