tsファイルで
import {ViewChild} from '@angular/core'
import { IonContent } from '@ionic/angular
を読み込んだあと,
@ViewChild(IonContent, { static: false }) content: IonContent;
でIoncontentを参照する(@ViewChild(‘ion-content’) content: IonContent;とかくと動かない)
あとは
ionViewDidEnter(){ this.content.scrollToPoint(0, 600, 300) }
という感じで指定する.x,y,秒.
import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs'; import { HttpClient, HttpHeaders } from '@angular/common/http'; import {ViewChild} from '@angular/core' import { IonContent } from '@ionic/angular'; @Component({ selector: 'app-tab3', templateUrl: './tab3.page.html', styleUrls: ['./tab3.page.scss'], }) export class Tab3Page implements OnInit { //@ViewChild('ion-content') content: IonContent; @ViewChild(IonContent, { static: false }) content: IonContent; ionViewDidEnter(){ this.content.scrollToPoint(0, 600, 300) }