Image for how two Stack layouts arranged
<ScrollView orientation="horizontal">
<GridLayout rows="auto">
<StackLayout row="0" backgroundColor="lightblue">
<GridLayout columns="{{gridColmns}}">
<ng-container *ngFor="let listItem of header let i
= index " scrollDirection="horizontal" orientation="vertical">
<Label margin="2 2 2 2" [col]="i"
textWrap="true" class="tcB" [text]=listItem.headerName></Label>
</ng-container>
</GridLayout>
</StackLayout>
</GridLayout>
</ScrollView>
<ScrollView>
<ScrollView orientation="horizontal">
<GridLayout rows="auto">
<StackLayout row="0">
<RadListView #radList [items]="gridToMobile">
<ng-template tkListItemTemplate let-item="item"
let-itemIndex="index">
<StackLayout padding="5"
orientation="horizontal" class="positioning">
<GridLayout columns="{{gridColmns}}">
<ng-container *ngFor="let listItem of
item let i = index " scrollDirection="horizontal"
orientation="vertical">
<Label position="fixed" margin="2
2 2 2" [col]="i" textWrap="true" class="tcB"
[text]=listItem.value></Label>
</ng-container>
</GridLayout>
</StackLayout>
</ng-template>
</RadListView>
</StackLayout>
</GridLayout>
</ScrollView>
</ScrollView>上面是两个堆栈布局的代码,任何无缝的方式让滚动同步两个堆栈布局。
已尝试使用另一个触发滚动事件,但未按预期工作。
发布于 2018-10-02 14:49:59
看起来顶部的块是列表视图的标题。您可以使用列表视图的header属性。
<ng-template tkListViewHeader>
<GridLayout rows="auto">
<StackLayout row="0" backgroundColor="lightblue">
<GridLayout columns="{{gridColmns}}">
<ng-container *ngFor="let listItem of header let i
= index " scrollDirection="horizontal" orientation="vertical">
<Label margin="2 2 2 2" [col]="i"
textWrap="true" class="tcB" [text]=listItem.headerName></Label>
</ng-container>
</GridLayout>
</StackLayout>
</GridLayout>
</ng-template>https://stackoverflow.com/questions/52524733
复制相似问题