android - 如何在 nativescirpt radlistview 上获取固定标题和滚动列表项
问题描述
我的示例代码在这里。问题是当我滚动列表标题时会消失,它应该固定在适当的位置。根据我的要求。
<lv:RadListView.headerItemTemplate>
<GridLayout rows="auto" columns="*,*,*,*" borderWidth=".01" borderColor="#004C97" padding='5' class="bg fc4" fontWeight="bold">
<Label text="Date" fontSize="12" col='0' fontWeight="bold" textAlignment="left" />
<Label text="Category" col='1' fontSize="12" fontWeight="bold" verticalAlignment="center" textAlignment="left" />
<Label text="Amount" fontSize="12" col='3' fontWeight="bold" textAlignment="right" />
<Label text="Comments" col="2" fontSize="12" fontWeight="bold" verticalAlignment="center" textAlignment="left" />
</GridLayout>
</lv:RadListView.headerItemTemplate>
<lv:RadListView.itemTemplate>
<GridLayout rows="auto" columns="*,*,*,*" borderWidth=".01" borderColor="#004C97" padding='10' class="fc4" fontWeight="bold">
<Label text="{{date}}" fontSize="14" col='0' fontWeight="bold" textAlignment="left" />
<Label text="{{expenseCat}}" col='1' fontSize="14" fontWeight="bold" verticalAlignment="center" textAlignment="left" />
<Label text="{{expenseAmount}}" fontSize="14" col='3' fontWeight="bold" textAlignment="right" />
<Label text="{{comments}}" col="2" fontSize="14" fontWeight="bold" verticalAlignment="center" textAlignment="left" />
</GridLayout>
</lv:RadListView.itemTemplate>
</lv:RadListView>
解决方案
将 GridLayout 与rows="auto,*"
. 将您的标题布局(第 0 行)放在 ListView(第 1 行)上方,使其保持固定。
推荐阅读
- c# - 使用指针在函数中传递公共变量的地址
- sql - 如何在包含百分比的列中获得百分比计算的确切值
- reactjs - 如何从 objectArray 访问对象的字段
- spring - PKIX 路径构建失败:sun.security.provider.certpath.SunCertPathBuilderException:导入从 start.spring.io 生成的项目时
- javascript - 特定 div 的突变观察者
- r - 如何将向量拆分为特定列表?
- nrwl-nx - 如何使用 Nx 运行单个打字稿文件
- c# - Windows 窗体设计器无法从程序集“Microsoft.VisualStudio.DesignTools.Interaction”加载类型
- sql - 如何在 SQL Server 中使用 INFORMATION_SCHEMA 查找所有表之间的所有关系?
- angular - 使用 updatePassword 启用密码更改并重新验证 (Firebase+Angular)