开发者

iphone-startup screen: any way to manage control time(3-4 sec) in displaying Default.png

开发者 https://www.devze.com 2023-02-20 16:28 出处:网络
i have used simple Default.png for start开发者_如何学JAVAup screen.and it is working fine.But it disappears very soonIt want it to be on screen atleast 3-4 seconds .Any way to use timer or i have to u

i have used simple Default.png for start开发者_如何学JAVAup screen.and it is working fine.But it disappears very soonIt want it to be on screen atleast 3-4 seconds .Any way to use timer or i have to use an image view for splash screen. While searching on forums i also found that it is discouraged in Apple HUman Interface guidelines. Help please! Thanks.


Please see this: http://www.infinitezest.com/articles/application-delegate-for-the-first-iphone-application-explained.aspx

i think you are looking for some delegate like:

(void)applicationDidBecomeActive:(UIApplication *)application; 

You also can add the same Default Image Again when the application become active and remove it once you're ready to go.


Simply make the initial view of the app -- the actual app's view, not Default.png -- a full-screen window with an imageview containing the Default.png image, with a timer that hides it after whatever delay you'd like. When the app starts up it will display Default.png, and when it actually becomes active the same image will be in place, producing a seamless transition, which you'll hide on your schedule.


2 steps for ur question

  1. Add an imageview in ur mainwindow.nib to ur window and set its image as "urDefault.png"

  2. In ur AppDelegate.m

    -(BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    [self performSelector:@selector(removesplashimage) withObject:nil afterDelay:1.0]; [self.window makeKeyAndVisible];

    return YES; }

    -(void)removesplashimage {
    [UIView beginAnimations:nil context:NULL]; [UIView setAnimationDuration:0.7]; [imview setAlpha:0]; [UIView commitAnimations]; }

0

精彩评论

暂无评论...
验证码 换一张
取 消