应用程序在模拟器,设备上的白色屏幕上工作
我的应用程序有默认的MainWindow.xib,里面有一个NavigationController。现在我最近将它切换到无xib主窗口和RootViewController(UIViewController的子类),类似于HelloiPhone底部提供的示例:
我的Main.cs:
namespace MyApp {
public class Application {
static void Main(string[] args) {
UIApplication.Main(args, null, "MyApp.AppDelegate");
}
}
public class AppDelegate : UIApplicationDelegate {
UIWindow window;
// This method is invoked when the application has loaded its UI and its ready to run
public override bool FinishedLaunching(UIApplication app, NSDictionary options) {
RootViewController rootViewController = new RootViewController();
UINavigationController navigationController = new UINavigationController(rootViewController);
navigationController.LoadView();
navigationController.NavigationBar.BarStyle = UIBarStyle.Black;
window = new UIWindow(UIScreen.MainScreen.Bounds);
window.AddSubview(navigationController.View);
window.MakeKeyAndVisible();
return true;
}
// This method is required in iPhoneOS 3.0
public override void OnActivated(UIApplication app) {
}
public override void WillTerminate(UIApplication app) {
//Save data here
}
}
}
我的Info.plist:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>UILaunchImageFile</key>
<string>images/logo_320x480.png</string>
<key>UIStatusBarStyle</key>
<string>UIStatusBarStyleBlackOpaque</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
</dict>
</plist>
在模拟器上,一切似乎都很好。首先,显示启动图像,最后几秒钟后会出现rootView。
但是,部署到设备(iPod touch)时,rootView将不会显示。相反,在启动图像后屏幕变为白色。 (顶部的状态栏仍然存在)
这种方法有问题吗?我错过了什么吗?
没有找到相关结果
已邀请:
2 个回复
搁手
迪擅哨乘傅