-
17 Oct 2012 4:04 AM #1
Answered: How to CSS customize a NavigationView navigationBar
Answered: How to CSS customize a NavigationView navigationBar
Hi,
I'm trying to customize the automaticly added top NavigationBar in a NavigationView, this should be the template:
Screen Shot 2012-10-17 at 13.56.45.png
So the title is left, and the back button has a total different style. When I would click a date, the title would change to this date.
I can't style them using CSS only, there's just too many options to be disabled, and too many DIVs in DIVs.
The list below the toolbar was easy to manage using baseCls and itemCls options from ST, but I can't find any similar ways for the navigationBar.
Any ideas?
-
Best Answer Posted by mitchellsimoens
For the back button you need to actually edit the back button config. Here is a simple test case:
Code:Ext.Viewport.add({ xtype : 'navigationview', navigationBar : { backButton : { align : 'right' //moves it to the right }, /** * Add a 2nd button on right side */ items : [ { text : 'Finish', align : 'right' } ] }, items : [ { title : 'Home', html : 'home' }, { title : 'Another', html : 'another' } ] });
-
19 Oct 2012 4:26 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,714
- Vote Rating
- 438
- Answers
- 3113
For the back button you need to actually edit the back button config. Here is a simple test case:
Code:Ext.Viewport.add({ xtype : 'navigationview', navigationBar : { backButton : { align : 'right' //moves it to the right }, /** * Add a 2nd button on right side */ items : [ { text : 'Finish', align : 'right' } ] }, items : [ { title : 'Home', html : 'home' }, { title : 'Another', html : 'another' } ] });Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
19 Oct 2012 4:53 AM #3
Hey, in the mean time I changed the Navigationview to a Container , this way I could fully customize the CSS.
Unfortunately this meant I had to implement my own Push() and Pop() system.
I don't think I could have changed the topbar fully to make it look like the picture in the OP, some CSS settings (like padding) were already set and were difficult to override, unless I would have added a ton of very context-sensitive CSS maybe.
Maybe this component needs more CSS-selectors like other components?
Thanks for the reply!


Reply With Quote