【问题标题】:auto scroll to marker in svg image ionic 2自动滚动到svg图像离子2中的标记
【发布时间】:2017-10-11 15:48:11
【问题描述】:

我想在屏幕加载时滚动到x=350y=220

我的默认屏幕:

我想要:

【问题讨论】:

  • 向我们展示您的代码。

标签: angular typescript ionic2 autoscroll


【解决方案1】:

您可以像这样使用scrollTo(x, y, duration) 方法:

import { Component, ViewChild } from '@angular/core';
import { Content } from 'ionic-angular';

@Component({...})
export class MyPage{
  @ViewChild(Content) content: Content;

  ionViewDidEnter() {
    this.content.scrollTo(350, 220, 500); // Duration is 500 ms
  }
}

【讨论】:

    猜你喜欢
    • 2023-04-05
    • 1970-01-01
    • 2014-09-27
    • 2018-06-28
    • 1970-01-01
    • 2018-06-02
    • 2017-03-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多