-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(listview): incorrect layout when scroll (#6656)
- Loading branch information
1 parent
30df4d9
commit 63be78a
Showing
7 changed files
with
76 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { fromObject } from "tns-core-modules/data/observable"; | ||
|
||
export function onLoaded(args) { | ||
const page = args.object; | ||
page.bindingContext = fromObject({ | ||
items: [ | ||
{ id: 1, name: "Ter Stegen", role: "Goalkeeper" }, | ||
{ id: 3, name: "Piqué", role: "Defender" }, | ||
{ id: 4, name: "I. Rakitic", role: "Midfielder" }, | ||
{ id: 5, name: "Sergio", role: "Midfielder" }, | ||
{ id: 6, name: "Denis Suárez", role: "Midfielder\nSecond line for the sake of testing" }, | ||
{ id: 7, name: "Arda", role: "Midfielder" }, | ||
{ id: 8, name: "A. Iniesta", role: "Midfielder" }, | ||
{ id: 9, name: "Suárez", role: "Forward" }, | ||
{ id: 10, name: "Messi", role: "Forward" }, | ||
{ id: 11, name: "Neymar", role: "Forward\nSecond line for the sake of testing" }, | ||
{ id: 12, name: "Rafinha", role: "Midfielder\nSecond line for the sake of testing" }, | ||
{ id: 13, name: "Cillessen", role: "Goalkeeper\nSecond line for the sake of testing" }, | ||
{ id: 14, name: "Mascherano", role: "Defender" }, | ||
{ id: 17, name: "Paco Alcácer", role: "Forward" }, | ||
{ id: 18, name: "Jordi Alba", role: "Defender\nSecond line for the sake of testing" }, | ||
{ id: 19, name: "Digne", role: "Defender" }, | ||
{ id: 20, name: "Sergi Roberto", role: "Midfielder\nSecond line for the sake of testing" }, | ||
{ id: 21, name: "André Gomes", role: "Midfielder\nSecond line for the sake of testing" }, | ||
{ id: 22, name: "Aleix Vidal", role: "Midfielder" }, | ||
{ id: 23, name: "Umtiti", role: "Defender" }, | ||
{ id: 24, name: "Mathieu", role: "Defender" }, | ||
{ id: 25, name: "Masip", role: "Goalkeeper" }, | ||
] | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<Page loaded="onLoaded"> | ||
<ActionBar title="issue-ng-repo-1626"></ActionBar> | ||
|
||
<StackLayout backgroundColor="red"> | ||
<ListView items="{{ items }}" class="list-group"> | ||
<ListView.itemTemplate> | ||
<StackLayout> | ||
<StackLayout backgroundColor="gray"> | ||
<Label text="{{ name }}" class="list-group-item"></Label> | ||
<Label text="{{ id }}" class="list-group-item"></Label> | ||
</StackLayout> | ||
<StackLayout backgroundColor="darkgray"> | ||
<StackLayout backgroundColor="darkblue"> | ||
<Label text="{{ role }}"></Label> | ||
<Label text="id is odd" visibility="{{ id%2 == 1 ? 'visible' : 'collapsed' }}"></Label> | ||
</StackLayout> | ||
<StackLayout backgroundColor="darkred"> | ||
<Label text="{{ role }}"></Label> | ||
<Label text="id is odd" visibility="{{ id%2 == 1 ? 'visible' : 'collapsed' }}"></Label> | ||
</StackLayout> | ||
<Label text="{{ role }}"></Label> | ||
<Label text="id is odd" visibility="{{ id%2 == 1 ? 'visible' : 'collapsed' }}"></Label> | ||
</StackLayout> | ||
</StackLayout> | ||
</ListView.itemTemplate> | ||
</ListView> | ||
</StackLayout> | ||
</Page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters