Comments (9)
For a quick fix as @sean-perkins mentioned you can call _initNativeViewPager()
from the page instance to fix the initial load problem
from nativescript-pager.
Yes a temp solution 😊
from nativescript-pager.
Fixed in v7
from nativescript-pager.
@triniwiz but it's a temporal solution, right? @sean-perkins can you paste your solution here to help others with the same issue? thanks guys!
from nativescript-pager.
I lost the temporal solution of @sean-perkins 🙈
from nativescript-pager.
For the moment the solution is using a ng-container with an Observable array:
<ng-container *ngIf="(images | async)?.length > 0">
<Pager [items]="images | async" #pager class="pager">
<ng-template pagerItemTemplate let-i="index" let-item="item">
<GridLayout class="pager-item" rows="auto, *" columns="*" backgroundColor="red">
<Label [text]="item.title"></Label>
<Image row="1" [src]="item.image"></Image>
</GridLayout>
</ng-template>
</Pager>
</ng-container>
We can convert a regular array to an observable using:
import { of } from 'rxjs/observable/of'
...
images: Observable<any[]>
ngOnInit() {
let images = []
this.images = of(images)
}
Thanks guys and thank you so much @sean-perkins for your help!
from nativescript-pager.
Guys, by the other hand... My app is crashing when I use the following configuration from the template:
[selectedIndex]="currentPagerIndex" (selectedIndexChange)="onIndexChanged($event)"
Let me know what you think, thanks in advance! 👍
from nativescript-pager.
For the moment I'm using a variable loadingImages
with the ng-container to reload the component, because the selectedIndex doesn't work
from nativescript-pager.
Woww thanks @triniwiz, let me check! 👍
from nativescript-pager.
Related Issues (20)
- iOS orientation issue using Pager + HtmlView HOT 3
- Vue Template Selector HOT 1
- iOS: item snap does not work while swiping when using tns-ios-v8-beta HOT 6
- iOS Image pager jerked when I swipe left HOT 4
- Changing a property on nested object causes ordering problems HOT 6
- iOS indicator color is not applied HOT 3
- Add vertical and horizontal orientation at the same time HOT 2
- Pager discards global context
- Error angular 9.1.0 HOT 3
- Angular 10 @nativescript-community/ui-pager 13.0.0-alpha.5 module import is not working HOT 2
- @nativescript-community/ui-pager":"^13.0.0-alpha.7 - Error - cant resolve - element-registry, lang-facade HOT 3
- Error: Can't resolve '@nativescript/core/data/observable-array/observable-array' Nativescript 7 HOT 3
- 13.0.0-alpha.10 crash with transformers="scale"
- selectedIndexChange value is undefined.
- Just Programatically Control HOT 1
- Feature Request: Revamping swipeEnd events HOT 1
- Unshift + selectedIndex bugged HOT 8
- 3 Pages in one view HOT 1
- Textview keyboard dismisses after one key tap.
- Build error on NS 8.4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nativescript-pager.