My code is as follows:
<ion-scroll style="height:200px;">
<ion-item ng-repeat="items in Items" >
<!--repeat group-->
</ion-item>
</ion-scroll>
I have a scroll view of height = 200px, this looks ok on small devices, but when I view this on large device, the content appears too small because the height is '200px' which is comparatively small. So, what's the proper method of fixing this? I tried using height in percentages but it did not fix. Please, help and sorry for my bad English.
Use
vh
unit instead ofpx
.You can setvh
value from 1 to 100, 100 vh means full screen size. Your code will be:or if
height
does not work thenUsefull link about styling with
vh
.Here what did i do, in your scroll, wrap it with this class:
modal-parent
,modal-top
,modal-scroll
in you js define this function:
and you are ready to go by calling something like this
setScrollHeight('modal-parent', 'modal-top', 'modal-scroll',1 ,100);
basically,
modal-parent
will minusmodal-top
and the result will setmodal-scroll
's heightoffset
something like padding