Comments (10)
That's a layout issue. Can you provide your UI markup?
from nativescript-pulltorefresh.
Essentially the same example on the github page is within the schedules directive
<GridLayout>
<TabView #tabView class="tab-view" [selectedIndex]="tabindex" (selectedIndexChanged)="onSelectedIndexChanged(tabView.selectedIndex)">
<GridLayout *tabItem="{title: 'Planning'}">
<schedules></schedules>
</GridLayout>
</TabView>
</GridLayout>
from nativescript-pulltorefresh.
from nativescript-pulltorefresh.
yes, this is the view of the schedules
Do you have an example which uses nativescript/angular2?
<stack-layout>
<PullRefresh refresh="refresh()">
<GridLayout>
<ListView>
</ListView>
</GridLayout>
</PullRefresh>
</stack-layout>
refresh() {
alert("Hello World!")
}
from nativescript-pulltorefresh.
@bradmartin I got the view to work. Problem was the gridlayout between the pulltorefresh and listview directive
But, i cannot get the refresh event to work
from nativescript-pulltorefresh.
Also you have a grid-stack-schedules which doesn't seem necessary at quick glance. That might be causing an issue. I forget the specifics with the layouts on iOS and making this work. I've encountered it before and just tweaking the layout resolves the issue. I just never know what it is exactly :) I don't do a lot of iOS so I just get it working and move on. I'll ping Peter later or you can on the issue and see if he has any thoughts from your code.
from nativescript-pulltorefresh.
Yes right. The listview needs to be a direct child of PullToRefresh I got the correct syntax now for angular2. Maybe you should include this in your readme for angular2
main.ts
import {registerElement} from "nativescript-angular/element-registry";
registerElement("PullToRefresh", () => require("nativescript-pulltorefresh").PullToRefresh);
component.html
<PullToRefresh (refresh)="refresh($event)">
<ListView>
</ListView
</PullToRefresh>
component.ts
refresh(args) {
let pullRefresh = args.object;
alert("Hello World!");
pullRefresh.refreshing = false;
}
from nativescript-pulltorefresh.
So it's working now? If so I can add it to the README or if you want to submit a PR with that below the plain NS sample that would be great 😄
from nativescript-pulltorefresh.
I think an example in the readme is ok. If i ever get to check dive deeper in the code i'll create a PR
from nativescript-pulltorefresh.
hello, help me, i got same issue with this. Im use pulltorefresh, to get data from db and check them with current data.. not for listview..
this work perfectly for Android, but not for IOS. 😢
Here my code:
my UI.xml
<page navigatedTo="onNavigatedTo"
xmlns:PR="nativescript-pulltorefresh">
<ActionBar title="RAN1" class="action-bar">
</ActionBar>
<PR:PullToRefresh refresh="onRefresh">
<grid-layout rows="auto,*" columns="*">
<stack-layout col="0" row="0" class="ads" >
<label class="tanya" text="{{ question }}" textWrap="true" />
</stack-layout>
<stack-layout col="0" row="1" class="content" visibility="{{ showForm ? 'visible' : 'collapsed' }}">
<label class="label" text="Your Answer :" />
<grid-layout rows="auto, auto" columns="*, *" visibility="{{ showEssay ? 'visible' : 'collapsed' }}">
<text-field row="0" colSpan="2" id="answer" />
<button row="1" col="1" text="Lock" tap="onLock" horizontalAlignment="right" />
</grid-layout>
<grid-layout rows="auto" columns="*, *" visibility="{{ showOption ? 'visible' : 'collapsed' }}">
<button row="0" col="0" tap="onTapA" text="{{ option_a }}" />
<button row="0" col="1" tap="onTapB" text="{{ option_b }}" />
</grid-layout>
</stack-layout>
</grid-layout>
</PR:PullToRefresh>
</page>
my controller.js
function onRefresh(args){
var pullRefresh = args.object;
statusChecker.start().then(function(bool){
pullRefresh.refreshing = false;
if(bool){
condition = statusChecker.getStatusClass();
setQuestion();
}
else alert("Failed. Check your connection!");
});
}
from nativescript-pulltorefresh.
Related Issues (20)
- Indicator Color HOT 2
- Conditionnnal blocked plugin
- color and backgroundColor property applies to content element GridLayout HOT 1
- Fails to build on Android for Nativescript 6.0.0 HOT 1
- app:runsbg after updating to nativescript 6 HOT 1
- Not working with webview on android, for ios works fine HOT 5
- iOS bounce up on refresh and no animation HOT 10
- Class not found android.support.v4.widget.SwipeRefreshLayout.OnRefreshListener HOT 3
- Android ViewPager2 increased sensitivity HOT 2
- Not working on iOS onLoaded or programmatically HOT 2
- Changelog for 2.0.0 ?
- Wrong version being downloaded by default HOT 2
- exception with version 3 HOT 8
- Cannot read property 'SwipeRefreshLayout' of undefined HOT 2
- How to prevent pull to refresh when dragging down on Google Maps? HOT 1
- Cannot access 'PullToRefresh' before initialization HOT 3
- FR: add api to show refreshing-indicator by script
- NativeScript 7 Support HOT 2
- tns plugin add @nstudio/[email protected] HOT 1
- Move to community HOT 3
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-pulltorefresh.