Ionic 3.2 - How do I disable lead ionic content?
I am developing an application in Ionic 3.2 version. I have an ion highlight inside an ion scroll. I want to disable scrolling ion-content
and want to show ion-refresher
inside ion-scroll
when scrolling ion-list
. But this fails.
- I tried
no-bounce
(<ion-content no-bounce>
) anddisable-scroll
(<ion-content disable-scroll>
) but still the content is scrolling - I tried to install
ion-fixed
insidecontent
and insidediv
just belowcontent
. But then ition-refresher
doesn't work. - I tried
scroll="false"
(as in ionic version 1.0) but still looping
Below code;
<ion-content scroll="false">
<ion-scroll scrollY="true" style="width: 100% !important;height:30% !important">
<ion-refresher (ionRefresh)="fill_data($event)">
<ion-refresher-content pullingIcon="arrow-dropdown" pullingText="{{ 'pull_to_refresh' | translate }}" refreshingSpinner="circles"
refreshingText="{{ 'refreshing' | translate }}">
</ion-refresher-content>
</ion-refresher>
<ion-list>
//data filling here
</ion-list>
</ion-scroll>
</ion-content>
Please help me...
source to share
This is how I did it now - same problem as you @Tony
With this SCSS, my list is scrolling and I may have items underneath:
page-home {
.scroll-content {
overflow: hidden;
}
ion-list {
overflow-y: auto;
max-height: 72vh;
}
}
I've tried using ionic scroll
and other options, but none seem to work right now.
source to share
<ion-content>
<ion-grid>
<ion-row>
<ion-col>
<ion-scroll style="width:100%;height:100px" scrollY="true">
<ion-list scroll="true">
<ion-item *ngFor="let item of testData">
<div>{{item}}</div>
</ion-item>
</ion-list>
</ion-scroll>
</ion-col>
</ion-row>
</ion-grid>
<p>other data</p>
<ion-list>
<ion-item>
1
</ion-item>
<ion-item>
1
</ion-item>
<ion-item>
1
</ion-item>
</ion-list>
</ion-content>
andin .ts
file:
testData = [];
constructor(public navCtrl: NavController) {
for(let i =0;i<100;i++){
this.testData.push(i);
}
}
check this plunk
source to share
You can debug your Ios Ionic app using Safari, while debugging you can notice which one is efficient.
.scroll-content {
overflow-y: hidden !important;
}
It will disable the scrolling of the ionic content and also disable the scrolling of the ionic list.
div.scroll-content {
bottom: 0px !important;
}
It is more efficient to disable scrolling of ionic content. It prevents only ionic content but ionic list
source to share