本文整理汇总了C#中UIWindow.Add方法的典型用法代码示例。如果您正苦于以下问题:C# UIWindow.Add方法的具体用法?C# UIWindow.Add怎么用?C# UIWindow.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UIWindow
的用法示例。
在下文中一共展示了UIWindow.Add方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FinishedLaunching
// This method is invoked when the application has loaded its UI and its ready to run
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
MonoMobileApplication.NavigationController = new UINavigationController();
_Window = new UIWindow(UIScreen.MainScreen.Bounds);
if (UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Pad)
_DefaultImage = UIImage.FromBundle("DefaultiPad.png");
else
_DefaultImage = UIImage.FromBundle("Default.png");
if (_DefaultImage != null)
{
var imageView = new UIImageView(_Window.Bounds);
imageView.Image = _DefaultImage;
_Window.Add(imageView);
_Window.BackgroundColor = UIColor.Clear;
}
MonoMobileApplication.NavigationController.View.Alpha = 0.0f;
_Window.AddSubview(MonoMobileApplication.NavigationController.View);
_Window.MakeKeyAndVisible();
MonoMobileApplication.Window = _Window;
BeginInvokeOnMainThread(()=> { Startup(); });
return true;
}
示例2: FinishedLaunching
public override bool FinishedLaunching (UIApplication app, NSDictionary options)
{
_mainCtr = new MainViewController();
_navCtr = new UINavigationController(_mainCtr);
_window = new UIWindow(UIScreen.MainScreen.Bounds);
_window.Add(_navCtr.View);
_window.MakeKeyAndVisible ();
return true;
}
示例3: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
_window = new UIWindow(UIScreen.MainScreen.Bounds);
// Add the the splash controller
_splashScreenController = new SplashScreenController();
_window.BackgroundColor = UIColor.FromRGBA(0x36, 0x36, 0x36, 1);
_window.Add(_splashScreenController.View);
_window.MakeKeyAndVisible();
return true;
}
示例4: FinishedLaunching
public override void FinishedLaunching(UIApplication app)
{
NSError err;
AVAudioSession.SharedInstance().SetCategory(AVAudioSession.CategoryAmbient, out err);
var image = new UIImage(@"splash.png");
UIImageView view = new UIImageView(image);
startWindow = new UIWindow(UIScreen.MainScreen.Bounds);
startWindow.RootViewController = new LaunchController();
startWindow.Add(view);
startWindow.MakeKeyAndVisible();
splashStart = DateTime.UtcNow;
}
示例5: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
// Set the repository type
_sqliteRepository = new SqliteRepository();
Repository.SetInstance(_sqliteRepository);
Repository.Default.CreateDatabase();
// Get the settings
Settings.Read();
_rootController = new RootController();
_window = new UIWindow(UIScreen.MainScreen.Bounds);
_window.Add(_rootController.View);
_window.MakeKeyAndVisible();
return true;
}
示例6: FinishedLaunching
public override bool FinishedLaunching(UIApplication app, NSDictionary options)
{
window = new UIWindow (UIScreen.MainScreen.Bounds);
txtConsole.BackgroundColor = UIColor.Black;
txtConsole.TextColor = UIColor.LightGray;
txtConsole.Font = UIFont.FromName ("Courier New",11);
txtConsole.Text = "SharpSSH for iPhone\r\n";
window.Add (txtConsole);
ConsoleReader = new System.Threading.Thread(ReadConsole);
ConsoleReader.Start ();
T = NSTimer.CreateRepeatingScheduledTimer(1, delegate() {
InvokeOnMainThread (delegate {
string x = ssh.ReadResponse ();
txtConsole.Text += x+"\r\n";
});
});
window.MakeKeyAndVisible ();
return true;
}
示例7: Game
public Game()
{
// Initialize collections
_services = new GameServiceContainer();
_gameComponentCollection = new GameComponentCollection();
//Create a full-screen window
_mainWindow = new UIWindow (UIScreen.MainScreen.Bounds);
_view = new GameWindow();
_view.game = this;
_mainWindow.Add(_view);
// Initialize GameTime
_updateGameTime = new GameTime();
_drawGameTime = new GameTime();
}
示例8: StartGame
internal void StartGame()
{
// Note: If the handling of the graphics device gets more complicated,
// this may have to be split into functions around what needs to be done before,
// during and after graphics device creation:
ApplyChanges();
// Create the game's window and view:
mainWindow = new UIWindow(UIScreen.MainScreen.Bounds);
gameViewController = new ExEnEmTouchGameViewController(game, this);
gameView = (ExEnEmTouchGameView)gameViewController.View;
// Start the game
gameView.StartGame();
// Calling StartGame does this:
// - creates the frame buffer
// - Calls InternalCreateDevice on this (creating the graphics device and calling DoDeviceCreated)
// - calls Initialize and then Update/Draw on Game (to fill backbuffer before becoming visible)
// Now that Game has started, make the window visible:
mainWindow.Add(gameView);
mainWindow.MakeKeyAndVisible();
}
示例9: iOSGamePlatform
public iOSGamePlatform(Game game) :
base(game)
{
game.Services.AddService(typeof(iOSGamePlatform), this);
// Setup our OpenALSoundController to handle our SoundBuffer pools
soundControllerInstance = OpenALSoundController.GetInstance;
Directory.SetCurrentDirectory(NSBundle.MainBundle.ResourcePath);
_applicationObservers = new List<NSObject>();
UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);
// Create a full-screen window
_mainWindow = new UIWindow (UIScreen.MainScreen.Bounds);
//_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
game.Services.AddService (typeof(UIWindow), _mainWindow);
_viewController = new iOSGameViewController(this);
game.Services.AddService (typeof(UIViewController), _viewController);
Window = new iOSGameWindow (_viewController);
_mainWindow.RootViewController = _viewController;
_mainWindow.Add (_viewController.View);
_viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged;
Guide.Initialise(game);
}
示例10: ConfigNavMenu
private void ConfigNavMenu()
{
//create the initial view controller
//var rootController = (UIViewController)board.InstantiateViewController ("HomeViewController");
var rootController = new HomeViewController();
ProfileController = new ProfileViewController ();
//build the shared menu
JVMenuPopoverConfig.SharedInstance.MenuItems = new List<JVMenuItem>()
{
new JVMenuViewControllerItem()
{
//View exisiting view controller, will be reused everytime the item is selected
Icon = UIImage.FromBundle(@"HomeIcon"),
Title = "Home_Menu".Localize(),
ViewController = rootController,
},
new JVMenuViewControllerItem()
{
//New view controller, will be reused everytime the item is selected
Icon = UIImage.FromBundle(@"ProfileIcon"),
Title = "Profile_Menu".Localize(),
ViewController = ProfileController
},
new JVMenuViewControllerItem()
{
//New view controller, will be reused everytime the item is selected
Icon = UIImage.FromBundle(@"SettingsIcon"),
Title = "Settings_Menu".Localize(),
ViewController = new SettingsViewController()
},
new JVMenuViewControllerItem()
{
Icon = UIImage.FromBundle(@"AboutIcon"),
Title = "About_Menu".Localize(),
ViewController = new AboutViewController()
},
};
//create a Nav controller an set the root controller
NavigationController = new UINavigationController(rootController);
//setup the window
Window = new UIWindow(UIScreen.MainScreen.Bounds);
Window.RootViewController = NavigationController;
Window.ContentMode = UIViewContentMode.ScaleAspectFill;
Window.BackgroundColor = UIColor.FromPatternImage(JVMenuHelper.ImageWithImage(UIImage.FromBundle("app_bg1.jpg"),this.Window.Frame.Width));
Window.Add(NavigationController.View);
Window.MakeKeyAndVisible();
}
示例11: Game
public Game(UIViewController viewController = null)
{
// Initialize collections
_services = new GameServiceContainer();
_gameComponentCollection = new GameComponentCollection();
_gameComponentCollection.ComponentAdded += Handle_gameComponentCollectionComponentAdded;
_mainWindow = new UIWindow ( UIScreen.MainScreen.Bounds);
if(viewController != null)
{
_mainWindow.RootViewController = viewController;
}
FixupRotationIos7 (); // important to get proper _mainWindow bounds right now.
_view = new GameWindow(_mainWindow.Bounds, UIScreen.MainScreen.Scale);
GameWindow.game = this;
_mainWindow.Add(_view);
// Initialize GameTime
_updateGameTime = new GameTime();
_drawGameTime = new GameTime();
}
示例12: iOSGamePlatform
public iOSGamePlatform(Game game) :
base(game)
{
game.Services.AddService(typeof(iOSGamePlatform), this);
// Setup our OpenALSoundController to handle our SoundBuffer pools
soundControllerInstance = OpenALSoundController.GetInstance;
//This also runs the TitleContainer static constructor, ensuring it is done on the main thread
Directory.SetCurrentDirectory(TitleContainer.Location);
_applicationObservers = new List<NSObject>();
UIApplication.SharedApplication.SetStatusBarHidden(true, UIStatusBarAnimation.Fade);
// Create a full-screen window
_mainWindow = new UIWindow (UIScreen.MainScreen.Bounds);
//_mainWindow.AutoresizingMask = UIViewAutoresizing.FlexibleDimensions;
game.Services.AddService (typeof(UIWindow), _mainWindow);
_viewController = new iOSGameViewController(this);
game.Services.AddService (typeof(UIViewController), _viewController);
Window = new iOSGameWindow (_viewController);
_mainWindow.RootViewController = _viewController;
_mainWindow.Add (_viewController.View);
_viewController.InterfaceOrientationChanged += ViewController_InterfaceOrientationChanged;
//(SJ) Why is this called here when it's not in any other project
//Guide.Initialise(game);
}