Reputation: 77
I am just starting with ionic. I am trying to use the Ionic Horizontal Scroll Cards. It looks like this, codepen: http://codepen.io/drewrygh/pen/jEJGLx
Now when i am using it in a template which has this structure:
<ion-view title="Videos">
<ion-content>
<hscroller>
<hcard ng-repeat="item in items" index="{{$index}}" desc="{{item.desc}}" image="{{item.image}}"></hcard>
</hscroller>
</ion-content>
</ion-view>
But the scroll doesn't work on mobile, while searching i found that the hscroller element should be placed inside an ion-pane. But when i do that the list appears for a micro second and then disappears. I can't figure out why.
code pen: http://codepen.io/anon/pen/RWRzPj
Here i have just added <ion-content> and <ion-pane>
tags around hscroller.
Upvotes: 1
Views: 3781
Reputation: 860
ion-scroll have support for horizonal scrolling.
Use
<ion-scroll direction="x" style="white-space: nowrap"></ion-scroll>
to replace your code
<hscroller></hscroller>
Upvotes: 1
Reputation: 2665
Why not use a <ion-scroll>
with horizontal scroll. You can easily create horizontal card view with that.
PS: the last code pen you provided. You needed to add
.scroll{
height:100%
}
Though this does not solve the scroll issue, for that I suggest the above.
Upvotes: 1