【问题标题】:Alloy ListView with static Header使用静态 Header 合金 ListView
【发布时间】:2016-03-22 04:14:36
【问题描述】:

是否可以将ListViewHeaderView 设为静态以使其不会滚动?

<ListView id="agreementListView" onItemclick = "itemClickAgrmt" class="elementsList" defaultItemTemplate="finAgreement" >
    <HeaderView>
        <View class="row" >
            <Label class="lblAgr col1">Finance</Label>
            <Label class="lblAgr col2">Duration</Label>
            <Label class="lblAgr col3">Monthly</Label>
            <Label class="lblAgr col4">Down</Label>
        </View>
    </HeaderView>
    <Templates>

这个HeaderView 显示为顶部的另一行,滚动离开。

【问题讨论】:

    标签: appcelerator appcelerator-titanium appcelerator-alloy


    【解决方案1】:

    不,你不能。 HeaderView 坚持使用 ListView 并滚动。如果您想要静态视图,只需在其顶部的 ListView 之前添加一个视图即可。

    【讨论】:

      【解决方案2】:

      对于遇到此问题的任何人,这里是处理 HeaderView 滚动的摘要。

      在 iOS 上:

      • HeaderView 放在ListSection 中将始终使其保持在顶部,直到出现下一个标题视图。
      • HeaderView 放在ListView(而不是ListSection)中将始终与ListItems 一起滚动,并且不会收到onItemclick 事件。

      在 Android 上:

      • HeaderView 将始终滚动到任何位置。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-01-27
        • 1970-01-01
        • 2011-07-13
        • 2013-05-18
        • 1970-01-01
        • 2015-02-16
        • 1970-01-01
        相关资源
        最近更新 更多