This is because your page is not as long as the iPhone screen. If the screen is
480px height but your screen is only 300px, it can't scroll to somewhere that
doesn't exists…
Perhaps you should update your iui.css file, i add this line of code a while
ago:
body > *:not(.toolbar) {
display: none;
position: absolute;
margin: 0;
padding: 0;
left: 0;
top: 45px;
width: 100%;
height: auto;
min-height: 415px; <----- THIS IS THE LINE I'M TALKING ABOUT
-webkit-transition-duration: 300ms;
-webkit-transition-property: -webkit-transform;
-webkit-transform: translateX(0%);
}
Please, add this too:
body[orient="landscape"] > *:not(.toolbar) {
height: auto;
min-height: 268px;
}
I'm in a snippet atm that should solve that once for good. Still buggy for now,
if one of you guy want to help, i'm all for it :)
add this to iui.js to the iui object
adaptHeight: function(orient)
{
// SET MIN-HEIGHT OF ALL SCREENS TO BROWSER HEIGHT MNUS TOOLBAR
HEIGHT
// THIS IS BECAUSE TOLLBAR HEIGHT VALUE CAN CHANGE FROM THEME
TO THEME
var tbh = 0; // toolbar height
tbh =
document.getElementsByClassName('toolbar')[0].style.height; // doesn't work
tbh = 45; // using default theme value
CHANGING MIN-HEIGHT VALUE OF ALL SCREENS
for(var i=0; i<document.body.childNodes.length;i++)
{
var s= document.body.childNodes[i];
if(s.title!=undefined && s.title!='') {
s.style['height']=(window.innerHeight-(100-tbh))+'px';
}
};
}
and add this to " setOrientation " function
iui.adaptHeight(orient);
This code should fix the 415px min-height that doesn't render properly on
Android devices screens (800px height)
R.
Le 3 déc. 2010 à 20:18, Chrilith a écrit :
> Hi Alon,
>
> I have implemented similar behavior for a while now in WebApp.Net,
> perhaps you can check the code to see if you can find what you need.
> It is bound to the framework code so, it is not easy to give a
> solution for iUI but basically I save the scroll position for the
> views and restore it when sliding back, always moving to top before
> slide.
>
>
> On Nov 9, 5:47 pm, Alon Raskin <[email protected]> wrote:
>> I also ran into this and did exactly as Remi suggested (though the scrollTo
>> was added in my code, not the iui).
>> The only issue I now face is that when they hit the Back button I want them
>> to return to the spot they were on in the list. For example, if they scroll
>> half way down they should return to the same spot. I am still working on
>> this but if anyone has a suggestion I am all ears.
>>
>> Alon Raskin
>> e: [email protected]
>>
>>
>>
>> -----Original Message-----
>> From: [email protected] [mailto:[email protected]]
>> On Behalf Of Rémi Grumeau
>> Sent: Tuesday, November 09, 2010 6:14 AM
>> To: [email protected]
>> Subject: Re: iUI page load not scrolling to top
>>
>> My mum will love that reply : )
>>
>> R.
>>
>> Le 9 nov. 10 à 12:51, billreilly a écrit :
>>
>>> Remi:
>>
>>> Thank you very much... your solution fixed my problem... you're a
>>> genius!...
>>
>>> Bill
>>
>>> On Nov 9, 12:30 pm, "Rémi Grumeau" <[email protected]> wrote:
>>>> Hi folks,
>>
>>>> Search for the slidePages function and add a scrollTo in it.
>>>> That does the trick for me, can't tell if this cause some
>>>> regression... didn't found one btw.
>>
>>>> function slidePages(fromPage, toPage, backwards)
>>>> {
>>>> var axis = (backwards ? fromPage :
>>>> toPage).getAttribute("axis");
>>
>>>> clearInterval(checkTimer);
>>>> scrollTo(0, 1);
>>
>>>> sendEvent("beforetransition", fromPage, {out:true});
>>>> sendEvent("beforetransition", toPage, {out:false});
>>>> if (canDoSlideAnim() && axis != 'y')
>>>> {
>>>> ...
>>
>>>> R.
>>
>>>> Le 9 nov. 10 à 00:29, billreilly a écrit :
>>
>>>>> Johnny:
>>
>>>>> I'm having the same problem... go tohttp://www.passageweather.com/
>>>>> mobi
>>>>> and scroll down the initial page and click on one of the lower list
>>>>> items and you'll see what i mean... the next "page" shows the list
>>>>> in
>>>>> the middle, no title bar is seen unless you scroll back to the
>>>>> top...
>>>>> very annoying...
>>
>>>>> I tried the Trek version of the iui.js file as you did, and it
>>>>> solved
>>>>> this problem but caused other problems, so i've gone back to the
>>>>> real
>>>>> iui.js file...
>>
>>>>> Bill
>>
>>>>> On Oct 22, 11:38 pm, johnnydanger <[email protected]> wrote:
>>>>>> For some reason when I click on a link in a longer list (that
>>>>>> require
>>>>>> scrolling down) the new page is loaded scrolled down to the same
>>>>>> vertical location. This is very irritating as it requires
>>>>>> scrolling
>>>>>> back to thetopof the new page manually. I've looked at other sites
>>>>>> running iUI ( Trek Bikes for instance) and their sites aren't
>>>>>> exhibiting the same behavior. I can't figure it out... anybody
>>>>>> have
>>>>>> an idea as to what is going on? If I do target="_self" than of
>>>>>> course
>>>>>> it loads the new page at and is scrolled to thetop, but if I don't
>>>>>> use a target="" declaration the new AJAX loaded page snippet does
>>>>>> notscrollback to thetop.
>>
>>>>>> Thanks.
>>
>>>>> --
>>>>> You received this message because you are subscribed to the Google
>>>>> Groups "iPhoneWebDev" group.
>>>>> To post to this group, send email to [email protected].
>>>>> To unsubscribe from this group, send email to
>>>>> [email protected]
>>>>> .
>>>>> For more options, visit this group
>>>>> athttp://groups.google.com/group/iphonewebdev?hl=en
>>>>> .
>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "iPhoneWebDev" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to
>>> [email protected]
>>> .
>>> For more options, visit this group
>>> athttp://groups.google.com/group/iphonewebdev?hl=en
>>> .
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "iPhoneWebDev" group.
>> To post to this group, send email to [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group
>> athttp://groups.google.com/group/iphonewebdev?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "iPhoneWebDev" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/iphonewebdev?hl=en.
>
--
You received this message because you are subscribed to the Google Groups
"iPhoneWebDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/iphonewebdev?hl=en.