Nativescript Angular ScrollView 系绳项目到页面顶部
Nativescript Angular ScrollView tether item to top of page
我有一个顶部有图像的滚动视图,然后是搜索栏和列表。我试图做到这一点,以便搜索栏在向上滚动时不会离开页面顶部,以便列表在其下方滚动。
格式:
<ScrollView>
<Image src="testimage.png"></Image>
<Searchbar></Searchbar>
<ListView items></ListView>
</ScrollView>
有没有办法在 NativeScript 中做到这一点?
使用GridLayout,ListView本身自带滚动条
<GridLayout rows="auto,auto,*">
<!-- you might want to set a height for image, depends on your image source -->
<Image row="0" src="testimage.png"></Image>
<Searchbar row="1"></Searchbar>
<ListView row="2" ...></ListView>
</GridLayout>
我有一个顶部有图像的滚动视图,然后是搜索栏和列表。我试图做到这一点,以便搜索栏在向上滚动时不会离开页面顶部,以便列表在其下方滚动。
格式:
<ScrollView>
<Image src="testimage.png"></Image>
<Searchbar></Searchbar>
<ListView items></ListView>
</ScrollView>
使用GridLayout,ListView本身自带滚动条
<GridLayout rows="auto,auto,*">
<!-- you might want to set a height for image, depends on your image source -->
<Image row="0" src="testimage.png"></Image>
<Searchbar row="1"></Searchbar>
<ListView row="2" ...></ListView>
</GridLayout>