Tuesday 15 June 2010

Setting a global background image or color in iOS -


There is a problem with the following code.

1.) What I'm trying to achieve; - To display an image or color of a global background in an iOS App Dadget,

2.) What is happening; - The picture or color displayed indicates that the code is working properly because there are no errors or warnings.

3.) What is the problem; - The background color or image moves up the entire screen as it is above the top, so I do not find any element, i.e. uttext, button etc. Just background image .. Because it's working badly because, good ... use the user app!

4) What have I done; Below is the code snippet in my appendix that I am working with it. I know this works because it is in every UIViewController and I'm trying to do it again so I'm only in one place. Not 200 !!

  - (BOOL) Application: (UIApplication *) Application FinishLaunchingWithOptions: (NSDictionary *) launchOptions {// Set Background Image if (IDIOOM == IPAD) {self.window. BackgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed: @ "background.jpg"]]; } Else {// Gradient Background Add CAGradientLayer * bgLayer = [Background Layer Yellow Gradient]; BgLayer.frame = self.window.bounds; [Self. Window Layer dot splayer: Bizzlere on index: 0]; } // It is added if in-app purchases are used and the user fails in the middle of the connection transaction, then he will finalize the payment so that he can enter the download or download. // [Readings IAPHelper Shared Human]; Yes come back }   

Any ideas?

Regards, Jeremy

I solved that same problem with the UIViewController categories Which is in the normal file included. Therefore each UIviewController calls in its init function [self setmorroll]

This is my code: @interface colorviewcontroller: UIViewController - (zero) setMyColor; @end

No comments:

Post a Comment