exports.loaded = function(args) {
var page = args.object;
page.bindingContext = feedModel;
var controller = frameModule.topmost().ios.controller;
var navigationBar = controller.navigationBar;
var navigationItem = controller.visibleViewController.navigationItem;
try {
/* Create bar button item
first argument is what icon to show:
UIBarButtonSystemItemDone,
UIBarButtonSystemItemCancel,
UIBarButtonSystemItemEdit,
UIBarButtonSystemItemSave,
UIBarButtonSystemItemAdd,
UIBarButtonSystemItemFlexibleSpace,
UIBarButtonSystemItemFixedSpace,
UIBarButtonSystemItemCompose,
UIBarButtonSystemItemReply,
UIBarButtonSystemItemAction,
UIBarButtonSystemItemOrganize,
UIBarButtonSystemItemBookmarks,
UIBarButtonSystemItemSearch,
UIBarButtonSystemItemRefresh,
UIBarButtonSystemItemStop,
UIBarButtonSystemItemCamera,
UIBarButtonSystemItemTrash,
UIBarButtonSystemItemPlay,
UIBarButtonSystemItemPause,
UIBarButtonSystemItemRewind,
UIBarButtonSystemItemFastForward,
UIBarButtonSystemItemUndo,
UIBarButtonSystemItemRedo,
UIBarButtonSystemItemPageCurl */
var shareItem = new UIBarButtonItem(9, null, null);
// set item color with system constant
shareItem.tintColor = UIColor.whiteColor();
// add item to navigation bar
var actionButtonItems = [shareItem];
navigationItem.rightBarButtonItems = actionButtonItems;
// hide back button
navigationItem.setHidesBackButtonAnimated(true, false);
// change bar color, this time with RGB instead of system constant
navigationBar.barTintColor = UIColor.colorWithRedGreenBlueAlpha(0, 0.24, 0.45, 1);
// change title color
navigationBar.titleTextAttributes = new NSDictionary([UIColor.whiteColor()], [NSForegroundColorAttributeName]);
/* change status bar style
UIStatusBarStyleDefault,
UIStatusBarStyleLightContent,
UIStatusBarStyleBlackTranslucent,
UIStatusBarStyleBlackOpaque */
navigationBar.barStyle = 1;
}
catch (e) {
alert(JSON.stringify(e));
}
};
Forked from burkeholland/gist:b4580106f11d29236218
Last active
August 29, 2015 14:20
-
-
Save khadorkin/9ed050bdbfa85d93eded to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment