Replace your first <div [ngSwitch]="relationship" style="height:100%">
with <ion-scroll scrollY="true" [ngSwitch]="relationship" style="height:100%">
it will make your cards list scrollable and your segment button will stick to the top!
I’ve tried it and it worked. But when I added an ion-searchbar before the ion-segment the scroll doesn’t scroll all the way. I had button elements within the ion-card that are no long visible
Why dont you add the searchbar and the segment buttons in a ion-header ? That eay you will no longer need the ion-scroll . Your segment buttons , and searchbar will be wrapped each in a ion-toolbar into the ion-header. And if you have problems with the content which will get under the header just add an id to the content , lets say #contentId. After in your component get the content reference using ViewChild(“contentId”) contentId : Content. After in ngAfterViewInit, use this.contentId.resize()
I’ve tried what you’ve suggested with the segment buttons in the header, and with the searchbar removed but the problem still exists. I’m still unable to scroll.
ion-scroll tag doesn’t exist in Ionic 3… if you use it, the whole search page will disappear.
so there isn’t any solution to this problem yet.
Ion-segment automatically deactivates y-axis scroll for its contents…
Until Ionic team fixes this bug, the best solution to this problem is creating your own tabs based on Angular and then styling it using CSS3.
Angular tab uses regular divs so I think it will work well with looped ion-item tags. Go with angular 5 tabs instead of ion-segment. They function just the same…