Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

JS ERROR Error: Content must inherit from either UIScrollView, UIWebView or WKWebView! #46

Closed
hasbyalkaff opened this issue Jul 30, 2018 · 3 comments

Comments

@hasbyalkaff
Copy link

hasbyalkaff commented Jul 30, 2018

hello, help me, i got same issue with #18. But, I 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!");
    });
}
@bradmartin
Copy link
Collaborator

Have you tried wrapping your pullrefresh in a scrollview? That should work or putting the scroll inside the pullrefresh. I forget which way it goes from memory 馃槃

@milosmatic
Copy link

@hasbyalkaff @bradmartin You have to put <ScrollView> inside <PullToRefresh>.

@hc1213
Copy link

hc1213 commented Jan 17, 2019

maybe show the code in your demo is better~
thank you

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants