开发者

Buttons not working in XIB file

开发者 https://www.devze.com 2023-02-16 01:51 出处:网络
Heya, I have loaded a uiviewcontroller\'s view into the main window in the AppDelegate file.If i do it by loading a nib name (and create the UIViewController on the fly), the buttons in the xib file f

Heya, I have loaded a uiviewcontroller's view into the main window in the AppDelegate file. If i do it by loading a nib name (and create the UIViewController on the fly), the buttons in the xib file fire properly. If i do it like this, the buttons are inactive.

Happy to give more information, just unsure which info to give.

- (BOOL)application:(UIApplication *)application didFinishLaunc开发者_运维知识库hingWithOptions:(NSDictionary *)launchOptions {    

    launchScreen = [[LaunchScreen alloc] initWithNibName:nil bundle:nil];
    [launchScreen.view setUserInteractionEnabled:YES];
    [window addSubview:[launchScreen view]];
    [window makeKeyAndVisible];
    return YES;
}


Ok, I seem to have found the culprit, there was a ViewController in the main xib file that was being overlayed ontop of the buttons stopping them from being used.

0

精彩评论

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