This is a migrated thread and some comments may be shown as answers.

Marshalling iOS Navigation Bar attributes

2 Answers 24 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Brett
Top achievements
Rank 2
Brett asked on 24 Mar 2015, 06:36 AM
I've read the marshalling page but stil can't figure this out. What is the Javascript equivalent of this:
[[UINavigationBar appearance]setTitleTextAttributes:@{NSForegroundColorAttributeName: [UIColor blackColor]} forState:UIControlStateNormal]; 

I have a reference to the navbar using this code below so I'm wondering if it can be used to set the attributes:
var controller = frameModule.topmost().ios.controller;
controller.navigationBar.barTintColor = navbarColor; 

2 Answers, 1 is accepted

Sort by
0
Accepted
Jason Zhekov
Telerik team
answered on 24 Mar 2015, 10:00 AM
Hello,

The rough equivalent of what you want is this:

var attributes = new NSMutableDictionary();
attributes.setObjectForKey(UIColor.blueColor(), UITextAttributeTextColor);
controller.navigationBar.titleTextAttributes = attributes;

This will set the text color of the navigation bar title to blue. You can find out how to change the other attributes it in the apple docs.

Regards,
Jason Zhekov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Brett
Top achievements
Rank 2
answered on 24 Mar 2015, 12:04 PM
Perfect, thanks.
Tags
General Discussions
Asked by
Brett
Top achievements
Rank 2
Answers by
Jason Zhekov
Telerik team
Brett
Top achievements
Rank 2
Share this question
or