-
22 Jan 2013 12:05 AM #1
Ext.navigation.View navigationBar long title wrong alignment in Sencha Touch 2.1
Ext.navigation.View navigationBar long title wrong alignment in Sencha Touch 2.1
Hi.
When there is no additional buttons added to navigationBar of navigationView - everything is working well. I also works well if title is short. But when title is cut - there are problems with alignment and title behaves unexpectable. See screenshots:
iOS Simulator Screen shot Jan 22, 2013 11.01.39 AM.pngiOS Simulator Screen shot Jan 22, 2013 11.01.32 AM.pngiOS Simulator Screen shot Jan 22, 2013 11.01.24 AM.png
Here is the code on my NavigationView:
Actually, title looks good only when navigationView is first initialized. After pushing/popping views you can see on screenshots, what happens.Code:Ext.define("iCoordinator.view.time.Nav", { extend: 'Ext.navigation.View', xtype: 'timenavigationview', config: { autoDestory: true, navigationBar: { ui: 'default' } }, initialize: function () { var me = this; var nextIntervalBtn = Ext.create('Ext.Button', { itemId: "nextIntervalBtn", iconMask: true, iconCls: 'arrow_right', align: 'right', handler: this.onNextIntervalBtnClick, scope: this }); var previousIntervalBtn = Ext.create('Ext.Button', { itemId: "previousIntervalBtn", iconMask: true, iconCls: 'arrow_left', align: 'left', handler: this.onPreviousIntervalBtnClick, scope: this }); this.getNavigationBar().add([nextIntervalBtn, previousIntervalBtn]); me.getNextIntervalBtn = function() { return nextIntervalBtn; } me.getPreviousInteralBtn = function() { return previousIntervalBtn; } this.callParent(arguments); }, setTitle: function(title) { this.getNavigationBar().setTitle(title); }, onPreviousIntervalBtnClick: function() { this.fireEvent('previousIntervalCommand', this); }, onNextIntervalBtnClick: function() { this.fireEvent('nextIntervalCommand', this); } });
-
22 Jan 2013 7:18 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,656
- Vote Rating
- 435
With your provided test case, I don't see anything wrong.
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.
-
22 Jan 2013 12:08 PM #3
You are right, when navigationView is used separately (I tried it myself) - everything works well. But my bug appears if I put this navigationView inside other Container. I my case it is this container:
Code:Ext.define("iCoordinator.view.time.Main", { extend: 'Ext.Container', xtype: 'timemainview', config: { layout: 'fit' }, initialize: function () { var me = this; this.callParent(arguments); var timeNavigationView = { xtype: 'timenavigationview' } this.add([timeNavigationView]); } });
-
22 Jan 2013 12:10 PM #4
You can use this controller as an example:
Code:Ext.define('iCoordinator.controller.TimeController', { extend: 'Ext.app.Controller', config: { views: [ 'iCoordinator.view.time.Nav', 'iCoordinator.view.time.Main' ], refs: { timeNavigationView: 'timenavigationview' }, control: { timeNavigationView: { nextIntervalCommand: 'onNextIntervalCommand' } } }, onNextIntervalCommand: function() { var me = this; me.getTimeNavigationView().push({ title: 'Very long title goes here lalala', html: "Text content" }); } });
Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.


Reply With Quote