Angular 设置水平滚动位置-3
我正在尝试更改Angular 设置水平滚动位置-3,angular,ionic-framework,ionic2,ionic3,Angular,Ionic Framework,Ionic2,Ionic3,我正在尝试更改ion scroll元素的滚动位置,但没有获得。。这就是我尝试过的: ts import { Component, ViewChild, ElementRef } from "@angular/core"; @ViewChild("scroller", { read: ElementRef }) private scroller: ElementRef; this.scroller.nativeElement.style.background = "blue"; h
ion scroll
元素的滚动位置,但没有获得。。这就是我尝试过的:
ts
import { Component, ViewChild, ElementRef } from "@angular/core";
@ViewChild("scroller", { read: ElementRef })
private scroller: ElementRef;
this.scroller.nativeElement.style.background = "blue";
html
<ion-scroll #scroller scrollX="true" style="height: 21px; white-space: nowrap">
<div>... </div>
</ion-scroll>
这不起作用
this.scroller.nativeElement.scrollLeft = this.scroller.nativeElement.scrollWidth;
你试过这个问题的答案吗?