Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to stretch backgroundimage in UINavigationBar and UITabBar when autoresized

Tags:

ios

iphone

I've set a background image with rounded corners for my UINavigationBar and UITabBar, however during rotation, the backgrondimage repeats instead of stretches. Is there a way to stretch so the corners stay rounded?

Thanks!

like image 399
chourobin Avatar asked Dec 15 '11 09:12

chourobin


2 Answers

for ios5.0+ use [UIImage imageNamed:nil] resizableImageWithCapInsets] instead.

like image 67
Zayin Krige Avatar answered Oct 10 '22 11:10

Zayin Krige


Found it, it's [UIImage imageNamed:nil] stretchableImage...] etc.

like image 21
chourobin Avatar answered Oct 10 '22 11:10

chourobin