本文整理汇总了Java中org.robovm.apple.uikit.UIScreen类的典型用法代码示例。如果您正苦于以下问题:Java UIScreen类的具体用法?Java UIScreen怎么用?Java UIScreen使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UIScreen类属于org.robovm.apple.uikit包,在下文中一共展示了UIScreen类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// create and initialize the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.All;
RoboPlatform pf = RoboPlatform.create(window, config);
addStrongRef(pf);
// create our game
new CuteGame(pf);
// make our main window visible (the platform starts when the window becomes viz)
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例2: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// configure and create the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.All;
RoboPlatform plat = RoboPlatform.create(window, config);
// create and initialize our game
new Drop(plat);
// make our main window visible (this starts the platform)
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例3: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// create and initialize the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.All;
RoboPlatform pf = RoboPlatform.create(window, config);
addStrongRef(pf);
// create our game
new HelloGame(pf);
// make our main window visible (the platform starts when the window becomes viz)
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例4: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// create and initialize the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.Landscape;
RoboPlatform pf = RoboPlatform.create(window, config);
addStrongRef(pf);
new Physics(pf);
// make our main window visible (the platform starts when the window becomes viz)
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例5: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// configure and register the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.All;
RoboPlatform pf = RoboPlatform.create(window, config);
// create and initialize our game
TestsGame game = new TestsGame(pf, new String[0]);
// make our main window visible
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例6: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication app, UIApplicationLaunchOptions launchOpts) {
// create a full-screen window
CGRect bounds = UIScreen.getMainScreen().getBounds();
UIWindow window = new UIWindow(bounds);
// configure and create the PlayN platform
RoboPlatform.Config config = new RoboPlatform.Config();
config.orients = UIInterfaceOrientationMask.All;
RoboPlatform plat = RoboPlatform.create(window, config);
// create and initialize our game
new SimGame(plat);
// make our main window visible (this starts the platform)
window.makeKeyAndVisible();
addStrongRef(window);
return true;
}
示例7: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application,
NSDictionary<NSString, ?> launchOptions) {
window = new UIWindow(UIScreen.getMainScreen().getBounds());
GenderListTableViewController genderListTableViewController = new GenderListTableViewController();
UINavigationController navigationController = new UINavigationController(genderListTableViewController);
navigationController.addStrongRef(genderListTableViewController);
navigationController.setDelegate(new UINavigationControllerDelegateAdapter() {});
window.setRootViewController(navigationController);
window.setBackgroundColor(UIColor.colorWhite());
window.makeKeyAndVisible();
return true;
}
示例8: showAds
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
public void showAds() {
initializeAds();
final CGSize screenSize = UIScreen.getMainScreen().getBounds().size();
double screenWidth = screenSize.height();
double screenHeight = screenSize.width();
final CGSize adSize = adview.getBounds().size();
double adWidth = adSize.width();
double adHeight = adSize.height();
log.debug(String.format("Hidding ad. size[%s, %s]", adWidth, adHeight));
float bannerWidth = (float) screenWidth;
float bannerHeight = (float) (bannerWidth / adWidth * adHeight);
log.debug(String.format("%s, %s, %s", screenWidth, screenHeight, bannerHeight));
adview.setFrame(new CGRect(0,
screenHeight - bannerHeight,
bannerWidth, bannerHeight));
}
示例9: viewDidLoad
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public void viewDidLoad() {
super.viewDidLoad();
UIImageView backgroundImageView = new UIImageView(UIScreen.getMainScreen().getApplicationFrame());
backgroundImageView.setImage(UIImage.getImage("BackgroundLogin"));
getView().addSubview(backgroundImageView);
// Position of the Facebook button
double yPosition = 360;
if (UIScreen.getMainScreen().getBounds().getSize().getHeight() > 480f) {
yPosition = 450;
}
facebookLoginButton = new FBSDKLoginButton();
facebookLoginButton.setReadPermissions(Arrays.asList("public_profile", "user_friends", "email",
"user_photos"));
facebookLoginButton.setFrame(new CGRect((UIScreen.getMainScreen().getBounds().getWidth() - 244) / 2, yPosition,
244, 44));
facebookLoginButton.setDelegate(this);
facebookLoginButton.setTooltipBehavior(FBSDKLoginButtonTooltipBehavior.Disable);
getView().addSubview(facebookLoginButton);
}
示例10: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Metal samples can only be run on device
if(System.getProperty("os.name").toLowerCase().contains("simulator")) {
throw new Error("Metal samples can only be run on physical devices");
}
// Set up the view controller.
rootViewController = new MetalBasic2DViewController();
// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set the view controller as the root controller for the window.
window.setRootViewController(rootViewController);
// Make the window visible.
window.makeKeyAndVisible();
return true;
}
示例11: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
streetScrollerViewController = new StreetScrollerViewController();
// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set our viewcontroller as the root controller for the window.
window.setRootViewController(streetScrollerViewController);
// Make the window visible.
window.makeKeyAndVisible();
/*
* Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
* early.
*/
addStrongRef(window);
return true;
}
示例12: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
parentViewController = new ParentViewController();
rootNavigationController = new UINavigationController(parentViewController);
// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set our viewcontroller as the root controller for the window.
window.setRootViewController(rootNavigationController);
// Make the window visible.
window.makeKeyAndVisible();
// Attach an observer to the payment queue
SKPaymentQueue.getDefaultQueue().addTransactionObserver(StoreObserver.getInstance());
/*
* Retains the window object until the application is deallocated.
* Prevents Java GC from collecting the window object too early.
*/
addStrongRef(window);
return true;
}
示例13: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
window = new UIWindow(UIScreen.getMainScreen().getBounds());
window.setBackgroundColor(UIColor.white());
/* Setup a tab bar controller that handles our custom view controllers */
tabBarController = new UITabBarController();
tabBarController.addChildViewController(new MyStreamingMovieViewController());
tabBarController.addChildViewController(new MyLocalMovieViewController());
/* Set the tab bar controller as the root of our window. */
window.setRootViewController(tabBarController);
window.makeKeyAndVisible();
/*
* Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
* early.
*/
addStrongRef(window);
return true;
}
示例14: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
rootViewController = new RegionsViewController();
navigationController = new UINavigationController(rootViewController);
// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set our viewcontroller as the root controller for the window.
window.setRootViewController(navigationController);
// Make the window visible.
window.makeKeyAndVisible();
/*
* Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
* early.
*/
addStrongRef(window);
return true;
}
示例15: didFinishLaunching
import org.robovm.apple.uikit.UIScreen; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
rootViewController = new ViewController();
UINavigationController navController = new UINavigationController(rootViewController);
navController.getNavigationBar().setBarStyle(UIBarStyle.Black);
navController.getNavigationBar().setTranslucent(true);
// Create a new window at screen size.
window = new UIWindow(UIScreen.getMainScreen().getBounds());
// Set the view controller as the root controller for the window.
window.setRootViewController(navController);
// Make the window visible.
window.makeKeyAndVisible();
return true;
}