Results 1 to 6 of 6

Thread: Problem with Scroll on Android

  1. #1
    Sencha User eldiego34's Avatar
    Join Date
    Jul 2010
    Location
    Buenos Aires, Argentina
    Posts
    20

    Default Problem with Scroll on Android

    Hi i want to know if there is any problem with the scrollTo of sencha in Android. I don't know if it supports negative values or it just doesn't work properly.
    Here is an example of the code:

    Code:
    scroller.scrollTo({x:-90 ,y: -(20-(window.innerHeight - 90))})
    Thanks for all.

    Saludo.

  2. #2
    Sencha User eldiego34's Avatar
    Join Date
    Jul 2010
    Location
    Buenos Aires, Argentina
    Posts
    20

    Default

    Solved it, if anyone is interested.
    Here is the code

    Code:
    onLoad: function(){
            this.w_fullsize = this.imgEl.dom.naturalWidth;
            this.h_fullsize = this.imgEl.dom.naturalHeight;
    }
    Code:
    zoomInToHeight: function(reducedHeight, imageElement, yCoordinate){
                    var imageYRatio = (yCoordinate-45)/reducedHeight;
                    var xTranslate = 0;
                    if(this.w_fullsize>window.innerWidth){
                        xTranslate = -(this.w_fullsize-window.innerWidth)/2;
                    }
                    yTranslate = -imageYRatio*(this.h_fullsize-reducedHeight);
                    this.imgEl.dom.style.height = this.h_fullsize+'px';
                    this.imgEl.dom.style.width = this.w_fullsize+'px';
                    this.ownerCt.scroller.offset = {x: xTranslate,y: yTranslate};
                    this.ownerCt.scrollEl.dom.style.webkitTransform = 'translate3d(' + xTranslate + 'px, ' + yTranslate + 'px, 0)';
                }
    That's a function to zoom in and center the image on the panel. It works on Android and IOS.
    Saludo, Diego.
    [email protected]

    Buenos Aires, Argentina.

  3. #3
    Ext User
    Join Date
    Sep 2010
    Location
    Ireland
    Posts
    3

    Default

    Sorry I'm a n00b to Sencha, but I'm experiencing the exact same issue.
    Could you please go into a little more detail in how to implement the above code, please?
    A working example would be really helpful.

    I think this fix should be included in the main package as having the top taken up by a permanent address bar is just ugly.

  4. #4
    Sencha User eldiego34's Avatar
    Join Date
    Jul 2010
    Location
    Buenos Aires, Argentina
    Posts
    20

    Default

    You have a problem with the zoom or with the scrool?
    To solve the zoom thing in the forum is a code that works fine.
    I won't attack this kind of code if i'm a noob, start with simples codes.
    Saludo, Diego.
    [email protected]

    Buenos Aires, Argentina.

  5. #5
    Ext User
    Join Date
    Sep 2010
    Location
    Ireland
    Posts
    3

    Default

    With scrollTo, does the first chunk of code hide the addressbar?

  6. #6
    Sencha User eldiego34's Avatar
    Join Date
    Jul 2010
    Location
    Buenos Aires, Argentina
    Posts
    20

    Default

    The onLoad part sets up the variables (Height and Weight) of the component in this case the image.
    Saludo, Diego.
    [email protected]

    Buenos Aires, Argentina.

Similar Threads

  1. DD on Android NexusOne
    By sj_tt6 in forum Ext 3.x: Help & Discussion
    Replies: 0
    Last Post: 22 Jul 2010, 11:40 AM
  2. Android 1.x support
    By gatakka in forum Sencha Touch 1.x: Discussion
    Replies: 0
    Last Post: 15 Jul 2010, 11:19 AM
  3. Carousel on Android
    By VinylFox in forum Sencha Touch 1.x: Bugs
    Replies: 3
    Last Post: 21 Jun 2010, 2:05 PM
  4. Android Forms
    By andresm in forum Sencha Touch 1.x: Bugs
    Replies: 0
    Last Post: 18 Jun 2010, 9:55 AM
  5. Toolbars on Android
    By VinylFox in forum Sencha Touch 1.x: Bugs
    Replies: 4
    Last Post: 9 Jun 2010, 6:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •