This is a migrated thread and some comments may be shown as answers.

ScrollView size

2 Answers 320 Views
ScrollView (Mobile)
This is a migrated thread and some comments may be shown as answers.
Ioan
Top achievements
Rank 1
Ioan asked on 27 May 2014, 11:30 AM
I have a mobile app.
One of the views structure looks like this:
(the view's data-stretch attribute is set to false! otherwise my whole layout goes crazy)

Large ScrollView:
  -> page1:
         -> a chart      
         -> and below a grid
  -> page2:
         -> some buttons, a date picker
         -> a chart      
         -> and below a grid
  -> page3:
         -> a ListView:
                  -> some text
                  -> an input
                  -> a small ScrollView with some pictures 
I have issues with the last small ScrollView. I initiate this ScrollView only when it's into view (when the large ScrollView scroll event fires on third page).
The problems is it doesn't have any size, but when I resize the browser window the pictures show up and everything works ok.
If I statically define the ScrollView with no databinding, it also works without having to resize the browser window.
Below is the code generated when i dinamically initiate the scrollview. The problems seems to be with the second div which has height:1px
<li>
                    <div id="meterImageGallery" data-role="scrollview" class="km-widget km-scrollview"><div style="height: 1px; -webkit-transform-origin: 0% 0%;"><div class="km-virtual-page" style="width: 326px; -webkit-transform: translate3d(-326px, 0px, 0px);"></div><div class="km-virtual-page" style="width: 326px; -webkit-transform: translate3d(0px, 0px, 0px);">
<img class="meter-image" src="../ViewerService.svc/GetObjectImageById?id=485">
</div><div class="km-virtual-page" style="width: 326px; -webkit-transform: translate3d(326px, 0px, 0px);">
<img class="meter-image" src="../ViewerService.svc/GetObjectImageById?id=1067">
</div></div><ol class="km-pages"><li class="km-current-page"></li><li></li><li></li></ol></div>
                </li>




2 Answers, 1 is accepted

Sort by
0
Ioan
Top achievements
Rank 1
answered on 27 May 2014, 01:33 PM
It works if I refresh the ScrollView immediately after creating it:
  $("#imageGallery").data("kendoMobileScrollView").refresh();

0
Kiril Nikolov
Telerik team
answered on 28 May 2014, 01:39 PM
Hi Ioan,

In general nesting ScrollView inside a ScrollView is not supported and it is a scenario that we do not encourage our customers to use. In your case if the Scrollview works as expected after the refresh then it seems like that its parent element is not sized on when the widget is initialized, but as I already said this is unupported scenario.

Regards,
Kiril Nikolov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
ScrollView (Mobile)
Asked by
Ioan
Top achievements
Rank 1
Answers by
Ioan
Top achievements
Rank 1
Kiril Nikolov
Telerik team
Share this question
or