how to get fixed header and scrolling list item on nativescirpt radlistview

32
December 06, 2018, at 4:30 PM

my sample code here. the problem is when i scroll the list header will go off, which should be fixed in position. as per my requirement.

        <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>
Answer 1

Use a GridLayout with rows="auto,*". Place your header layout (0th row) above ListView (1st row) so it stays fixed.

READ ALSO
Android navigation architecture testing

Android navigation architecture testing

please help me to test android navigation architecture component by using androidarch

21
How to unregister multiple Broadcast receiver which are in different classes at a time?

How to unregister multiple Broadcast receiver which are in different classes at a time?

i want to unregister some broadcast receivers with single clickhere is the flow

44
Android App crashes only on specific devices

Android App crashes only on specific devices

I've recently released my first app on Google Play and many users installed it alreadyThere seem to be no problems so far, except 2 different errors reported by Google Play Console

40
Button swipe from center to left and right

Button swipe from center to left and right

I am crating one task management application in AndroidIn that one I have to create sign in/sign out option

39