2011-12-15 15 views
7

Ho un oggetto UIWindow che voglio mostrare in cima a uno storyboard. Che ho fatto come questo -UIWindow non visibile in cima allo storyboard

UIWindow *webWindow = [[UIWindow alloc] initWithFrame:CGRectMake(0, 20, 320,480)]; 
webWindow.windowLevel = UIWindowLevelAlert; 

sto facendo è keyAndVisible come questo -

[webWindow makeKeyAndVisible]; 

Il problema è che non è visibile. Ho cercato NSLog per vedere tutte le finestre e si vede qualcosa di simile -

Windows:(
    "<UIWindow: 0x9b5cf20; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x9b61400>>", 
    "<UIWindow: 0x9846880; frame = (0 0; 320 480); layer = <UIWindowLayer: 0x9846a60>>" 
) 

ho letto qualcosa su come finestra è utilizzato da Storyboard qui - http://developer.apple.com/library/ios/#documentation/UIKit/Reference/UIApplicationDelegate_Protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40006786-CH3-SW30

Ma la sua non è chiaro come usarlo per mostrare un finestra in cima allo Storyboard.

+0

Trovato! Anziché creare un nuovo oggetto UIWindow e aggiungere una sottoview per rendere l'oggetto delegato dell'app come -'ExampleAppDelegate * myApp = (ExampleAppDelegate *) [UIApplication sharedApplication] .delegate; 'E aggiungi subView come questo -' [myApp.window addSubview: aWebView]; ' – arank

+0

si prega di postare quel commento come risposta e accettarlo. Altre persone possono trovare utile :) –

risposta

1

Piuttosto che creare un nuovo oggetto UIWindow e aggiungere una sottoview a dover rendere oggetto dell'app delegato come -EsempioAppDelegate * myApp = (ExampleAppDelegate *) [UIApplication sharedApplication] .delegate; E aggiungi subView come questo - [myApp.window addSubview: aWebView];

+0

Ok, hai risolto ** il tuo ** problema, ma non hai risposto alla tua ** domanda **. A volte è necessario aggiungere un altro * UIWindow * not * UIView * –

Problemi correlati