This duplicates another bug already reported in our system: TOUCH-1039
  1. #1
    Sencha User
    Join Date
    May 2010
    Posts
    20
    Vote Rating
    0
    FidoX is on a distinguished road

      0  

    Default Animations doesn't work in packaged iOS application

    Animations doesn't work in packaged iOS application


    I was trying to package a sencha touch 2 app into a ios app using the phonegap packaging and I've found a couple of problems.

    The first one is I can't use the Ext.application initialization, if I use it, the launch method is not executed and only what I get is a white screen. I've solved it using the new Ext.Application instead.

    The other one, is the animations doesn't work at all! If I set any animation or use a widget that use it, the app stop working.
    Debugging a little I've found (by chance, more than anything else) an issue that only occur in the WebView of the iphone (Im using the emulator, not phisical) If I use the default browser all it's ok.

    The thing is in getTestElement method of Ext.fx.runner.CssTransition

    Code:
       getTestElement: function() {
           var testElement = this.testElement,
               iframe, iframeDocument, iframeStyle;
    
    
           if (!testElement) {
               iframe = document.createElement('iframe');
               iframeStyle = iframe.style;
               iframeStyle.visibility = 'hidden !important';
               iframeStyle.width = '0px !important';
               iframeStyle.height = '0px !important';
               iframeStyle.position = 'absolute !important';
               iframeStyle.zIndex = '-1000 !important';
    
    
               document.body.appendChild(iframe);
               iframeDocument = iframe.contentDocument;
    
    
               this.testElement = testElement = iframeDocument.createElement('div');
               testElement.style.position = 'absolute !important';
               iframeDocument.body.appendChild(testElement);
               this.testElementComputedStyle = window.getComputedStyle(testElement);
           }
    
    
           return testElement;
        },
    The problem is with the line iframeDocument.body.appendChild(testElement)
    I've detected that in the ios WebView the iframeDocument.body is null so you get a null exception when that code is executed. In order to solve it, I put a line before:

    Code:
    iframeDocument.body = document.createElement('body');
    Then the animations start working sucessfully.

    Anybody are using senchatouch 2 to package a native ios application? For me was too hard to get it work.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Thank you for this info and doing some debugging. I will send this to the core devs to see what they can do to alleviate this.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,330
    Vote Rating
    846
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Just an update, we have decided to push up as a bug!
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    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 in print!

    When posting code, please use BBCode's CODE tags.

Thread Participants: 1