简体   繁体   中英

Iphone/ipad background image

So I've followed this guide to putting a background to my main window http://howtomakeiphoneapps.com/2009/03/how-to-add-a-nice-background-image-to-your-grouped-table-view/

However, I am using a navigation controller, and when I push the navigation view(s) on the stack, the new views cover it (obviously). But I change all of the background colors of the navigation views to clear, but it still doesn't show the original view.

I'd like the background image to be there for the whole program. How can I do so while using the navigation controller and without having to create a new image for each subsequent view.

Thanks,

I don't know if the idea of setting the background to the navigation controller and then making the new ViewControllers in that stack be transparent can work. But I would create a singlelton UIImageView that would always be there and then on each onLoad just add it and make it be on the back of everything.

I would recommend following this pattern for the singlelton

在推送或添加之前,只需对所有视图控制器执行以下操作

yourViewController.view.backgroundColor = [UIColor clearColor];

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