Redraw on screen rotation

You must Login before you can answer or comment on any questions.

Is there any way to get the screen to redraw when the mobile screen rotates? I've got some ellipsized labels that don't get any longer when you rotate the device. Ideas? Suggestions? I'm doing it wrong?

Just a simple label with left and right set. seeing this behavior on android.

Titanium 2.1

— asked 11 months ago by Tyler Presley
1 Comment
  • More specific on the label { left: '5dip', right: '5dip', ellipsize: true, wordWrap: false }

    — commented 11 months ago by Tyler Presley

2 Answers

Accepted Answer

Hello Tyler,

See this....

// For Portrait & LandScap Resoluction .............
 
Titanium.Gesture.addEventListener('orientationchange', function(e) {
    switch (Titanium.Gesture.orientation) {
 
        // For LandScap.......
 
        case Titanium.UI.LANDSCAPE_LEFT:
 
        break;
 
        case Titanium.UI.LANDSCAPE_RIGHT:
 
        break;
 
        // For Portrait.......
 
        case Titanium.UI.PORTRAIT:
 
        break;
 
        case Titanium.UI.UPSIDE_PORTRAIT:       
 
        break;
    }
});
 
Titanium.Gesture.fireEvent('orientationchange');

— answered 11 months ago by Ritesh .
answer permalink
1 Comment
  • Sorry for the late mark. But I came across some other issues that had to be worked out before I got to this point. The problem I'm having now is that the ellipsized text is not expanding on redraw even though the label is getting an updated width...

    — commented 10 months ago by Tyler Presley

you need to reload the current js file, just like reset the window's url or reopen the window, or try to set the view=null and re-include the releate js, something like that.

Your Answer

Think you can help? Login to answer this question!