本文整理汇总了Java中org.robovm.apple.uikit.UINavigationController类的典型用法代码示例。如果您正苦于以下问题:Java UINavigationController类的具体用法?Java UINavigationController怎么用?Java UINavigationController使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UINavigationController类属于org.robovm.apple.uikit包,在下文中一共展示了UINavigationController类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的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;
}
示例2: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Remove the below lines to disable logging for release builds.
Flurry.setDebugLogEnabled(true);
Flurry.setLogLevel(FlurryLogLevel.All);
// Enable crash reporting.
Flurry.enableCrashReporting();
// Start Flurry.
Flurry.startSession(APP_KEY, launchOptions);
// Automatically log page views for all controllers in the view
// hierarchy of the root controller.
UINavigationController navController = (UINavigationController) getWindow().getRootViewController();
Flurry.logAllPageViews(navController);
return true;
}
示例3: shouldNavigateToPhoto
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
private void shouldNavigateToPhoto(PAPPhoto targetPhoto) {
for (PAPPhoto photo : homeViewController.getObjects()) {
if (photo.getObjectId().equals(targetPhoto.getObjectId())) {
targetPhoto = photo;
break;
}
}
// if we have a local copy of this photo, this won't result in a network
// fetch
targetPhoto.fetchIfNeededInBackground(new PFGetCallback<PAPPhoto>() {
@Override
public void done(PAPPhoto object, NSError error) {
if (error == null) {
UINavigationController homeNavigationController = tabBarController.getHomeNavigationController();
tabBarController.setSelectedViewController(homeNavigationController);
PAPPhotoDetailsViewController detailViewController = new PAPPhotoDetailsViewController(object);
homeNavigationController.pushViewController(detailViewController, true);
}
}
});
}
示例4: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的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;
}
示例5: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的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;
}
示例6: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的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;
}
示例7: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
iapStoreViewController = new IAPStoreProductViewController();
rootNavigationController = new UINavigationController(iapStoreViewController);
// 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();
/*
* Retains the window object until the application is deallocated. Prevents Java GC from collecting the window object too
* early.
*/
addStrongRef(window);
return true;
}
示例8: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// load our data source and hand it over to APLMainTableViewController
List<APLProduct> productsList = new ArrayList<>();
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iPhone", 2007, 599.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iPod", 2001, 399.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iPod touch", 2007, 210.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iPad", 2010, 499.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iPad mini", 2012, 659.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "iMac", 1997, 1299.00));
productsList.add(new APLProduct(APLProduct.getDeviceTypeTitle(), "Mac Pro", 2006, 2499.00));
productsList.add(new APLProduct(APLProduct.getPortableTypeTitle(), "MacBook Air", 2008, 1799.00));
productsList.add(new APLProduct(APLProduct.getPortableTypeTitle(), "MacBook Pro", 2006, 1499.00));
UINavigationController navigationController = (UINavigationController) getWindow().getRootViewController();
// note we want the first view controller (not the
// visibleViewController) in case
// we are being store from UIStateRestoration
APLMainTableViewController viewController = (APLMainTableViewController) navigationController
.getViewControllers().get(0);
viewController.setProducts(productsList);
return true;
}
示例9: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public boolean didFinishLaunching(UIApplication application, UIApplicationLaunchOptions launchOptions) {
// Set up the view controller.
rootViewController = new RootViewController();
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();
return true;
}
示例10: didFinishLaunching
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public boolean didFinishLaunching (UIApplication application, UIApplicationLaunchOptions launchOptions) {
window = new UIWindow(UIScreen.getMainScreen().getBounds());
window.setBackgroundColor(UIColor.lightGray());
UINavigationController navigationController = new UINavigationController(application.addStrongRef(new ViewController()));
window.setRootViewController(navigationController);
window.makeKeyAndVisible();
// Ties UIWindow instance together with UIApplication object on the
// Objective C side of things
// Basically meaning that it wont be GC:ed on the java side until it is
// on the Objective C side
application.addStrongRef(window);
return true;
}
示例11: PAPSettingsActionSheet
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
public PAPSettingsActionSheet(final UINavigationController navController) {
super(null, new UIActionSheetDelegateAdapter() {
@Override
public void clicked(UIActionSheet actionSheet, long buttonIndex) {
if (navController == null) {
throw new RuntimeException("navController cannot be null");
}
switch ((int) buttonIndex) {
case 1: // PROFILE
PAPAccountViewController accountViewController = new PAPAccountViewController(
PAPUser.getCurrentUser());
navController.pushViewController(accountViewController, true);
break;
case 2: // FIND FRIENDS
PAPFindFriendsViewController findFriendsVC = new PAPFindFriendsViewController();
navController.pushViewController(findFriendsVC, true);
break;
case 3: // LOGOUT
// Log out user and present the login view controller
((AnyPicApp) UIApplication.getSharedApplication().getDelegate()).logOut();
break;
default:
break;
}
}
}, "Cancel", null, "My Profile", "Find Friends", "Log Out");
}
示例12: viewDidLoad
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
@Override
public void viewDidLoad() {
super.viewDidLoad();
getTabBar().setTintColor(UIColor.fromRGBA(254f / 255f, 149f / 255f, 50f / 255f, 1));
getTabBar().setBarTintColor(UIColor.fromRGBA(0, 0, 0, 1));
navController = new UINavigationController();
}
示例13: canPerformUnwind
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
/**
* We must disambiguate which QuestionViewController should handle the
* exitToQuizStart: action as there will be several QuestionViewController
* instances on the navigation stack when the unwind segue is triggered. By
* default, a UINavigationController (or QuizContainerViewController)
* searches its viewControllers array in reverse. Without overriding this
* method, the QuestionViewController directly preceding the results screen
* would be selected as the destination of the unwind segue.
*/
@Override
public boolean canPerformUnwind(Selector action, UIViewController fromViewController, NSObject sender) {
// Always check if the view controller implements the unwind action by
// calling the super's implementation.
if (super.canPerformUnwind(action, fromViewController, sender)) {
// The first QuestionViewController in the navigation stack should
// handle the unwind action.
return this == ((UINavigationController) getParentViewController()).getViewControllers().get(0);
}
return false;
}
示例14: prepareForSegue
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
/**
* This method will be called when the 'Begin' button is tapped.
*/
@Override
public void prepareForSegue(UIStoryboardSegue segue, NSObject sender) {
// Create a new Quiz from the questions.xml file in the bundle
// resources.
String questionsPath = NSBundle.getMainBundle().findResourcePath("questions", "xml");
Quiz newQuiz = new Quiz(questionsPath);
// Set the newQuiz as the currentQuiz of the destination view
// controller.
QuestionViewController firstQuestionVC = (QuestionViewController) ((UINavigationController) segue
.getDestinationViewController())
.getViewControllers().get(0);
firstQuestionVC.setQuiz(newQuiz);
}
示例15: showNewPersonViewController
import org.robovm.apple.uikit.UINavigationController; //导入依赖的package包/类
/**
* Called when users tap "Create New Contact" in the application. Allows
* users to create a new contact.
*/
private void showNewPersonViewController() {
ABNewPersonViewController picker = new ABNewPersonViewController();
picker.setNewPersonViewDelegate(this);
UINavigationController navigation = new UINavigationController(picker);
presentViewController(navigation, true, null);
}