Hemang
Hemang

Reputation: 27050

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?

Upvotes: 0

Views: 223

Answers (1)

Pravin Tate
Pravin Tate

Reputation: 1130

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 (i.e. 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.

Upvotes: 1

Related Questions