Вопрос

I want to use custom graphics as UINavigationBar background:

[[UINavigationBar appearance]
    setBackgroundImage:[UIImage imageNamed:@"tile"]
    forBarMetrics:UIBarMetricsDefault];

Works fine, except I lost default gradient, white line at top and black line at bottom of the titlebar. Any ideas how to get them back?

Это было полезно?

Решение

Gave up and added gradient and lines into the texture. Of course this meant that I had to hardcode texture height as 44 pixels == navigation bar size for vertical orientation.

Not happy with the solution, but it does work without any problems.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top