简体   繁体   中英

iOS : subclassing UINavigationBar for custom title view

I've subclassed UINavigationBar , I wanted to have a UIView contains UIImageView + UILabel inside it, I'm able to achieve it by setting titleView property. But, what I want to know is whether its possible to add it inside subclass directly?

Better way add one UIView on Navigationbar and then add any component on that so it is easy to manage those component because if you add component on left button right button and title label it not that much flexible to customise (ie if you added any component on titleLabel you can set that component frame only equal or less that title label. but if you add on UIView on Navigation bar then you can customise all components easily)

I hope it will help you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM