在离子段内滚动

时间:2018-01-20 20:57:14

标签: html angular ionic-framework ionic2

我们可以将ionic2段标题滚动到点击的段标题

<div>
    <ion-scroll #scroll scrollX="true" class="browse-item-scrollx">
        <ion-segment  [(ngModel)]="pet" color="primary">
            <ion-segment-button (click)="goto(0)" value="1" tappable>
                1
            </ion-segment-button>
            <ion-segment-button (click)="goto(1)" value="2" tappable>
                2
            </ion-segment-button>
            <ion-segment-button (click)="goto(2)" value="3" tappable>
                3
            </ion-segment-button>
            <ion-segment-button (click)="goto(3)" value="4" tappable>
                4
            </ion-segment-button>
        </ion-segment>
    </ion-scroll>

</div>

第1,第2段标题可见;第3段标题是半可见的;第4段不可见。所以当用户点击第3段标题时,它应该滚动,第3段标题应该完全可见。是否可以这样做。

0 个答案:

没有答案