8 Oct 2012 2:13 PM #1
Unanswered: TitleBar text truncation is not updated when the toolbar is hidden
I have a TitleBar with several buttons. If the screen is not wide enough to fit the title and the buttons, it will rightly truncate the title, e.g. if the title is "My Long Title":
[BUTTON] My Lon... [BUTTON]
However, let's say the screen is in landscape mode and it can fit the whole title. Then, I hide the toolbar, rotate the device, and show the toolbar. Now it can't fit the whole title, but it is not updated so the title overlaps one of the buttons.
Is this a bug? Or if it's by design, then how I can I override the behavior so that it will update the toolbar when I show it?
9 Oct 2012 7:17 AM #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
The TitleBar has to calculate the width of the text but when it's hidden it doesn't really have a width.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!
When posting code, please use BBCode's CODE tags.
9 Oct 2012 12:25 PM #3
So how do I get it to recalculate the text width after I show it?
9 Oct 2012 11:38 PM #4
I believe the private method refreshTitlePosition() does what you want. In my case i had to call it with a small delay after showing the titlebar. Please mind that the use of private methods of ST is discouraged.
10 Oct 2012 1:00 AM #5
Do update to ST 2.1