Comments (10)
Hi folks, I ran into the same issue and here's how I sorted it out:
I got the modal reference
@ViewChild('modal', { static: false}) modal: ElementRef<View>;
then I passed the nativeView into the android.view option:
this.modal.nativeElement.nativeView
and it showed correctly!
hope it helps!
btw I'm using Nativescript Angular.
from nativescript-loading-indicator.
Can you provide your code to show the loader? There is an option to specify where you wanna open it from. This seems like something you should be able to leverage for now with the modal.
from nativescript-loading-indicator.
I used pretty basic standard codes so didn't even mention that.
Originating page
exports.supportForm = function(args){ // fires on click of a button
page.showModal("about/support-page", {
fullscreen: true
});
}
Modal page
const LoadingIndicator = require('@nstudio/nativescript-loading-indicator').LoadingIndicator;
const Mode = require('@nstudio/nativescript-loading-indicator').Mode;
const loader = new LoadingIndicator();
xports.onShownModally = function(args) {
//initializing code
}
exports.send = function(args){ // triggers by a button on modal page
loader.show();
}
from nativescript-loading-indicator.
You could possibly try grabbing the args.object
in the onShownModally
and using that for the view
in the android options to pass to show()
https://github.com/nstudio/nativescript-loading-indicator#android-specific
this might not work exactly and require some changes but the modal dialog in NS on android is a DialogFragment
so it might. If not, I would put a view inside the modal
like a text label or something and get it via its loaded
event and then pass that into the show()
for the android.view
option as view: yourlabel.android;
.
from nativescript-loading-indicator.
Ok. I'll give that a try.
from nativescript-loading-indicator.
Did you get this working @VeeK727? I'm having the same issue.
from nativescript-loading-indicator.
No, I used an ActivityIndicator because it worked better in my particular situation but the method @bradmartin suggested is likely to work.
from nativescript-loading-indicator.
Thanks @VeeK727. Unfortunately @bradmartin's suggestion does not appear to work. I tried this...
XML:
<Page shownModally="onShownModally" xmlns="http://schemas.nativescript.org/tns.xsd">
<ScrollView>
<FlexboxLayout class="page" loaded="onLoaded">
<Label text="Page Content" />
</FlexboxLayout>
</ScrollView>
</Page>
TS:
import { LoadingIndicator, OptionsCommon } from '@nstudio/nativescript-loading-indicator';
export function onLoaded(args) {
const flex = <FlexboxLayout>args.object;
const loadingIndicator: LoadingIndicator = new LoadingIndicator();
const loadingOptions: OptionsCommon = {
message: 'Loading...',
details: 'Additional detail note!',
dimBackground: true,
color: '#FFFFFF',
backgroundColor: '#FE5000',
android: {
view: flex.android
},
ios: {
view: flex.ios
}
}
loadingIndicator.show(loadingOptions);
}
I also tried using the args.object
from onShownModally
as @bradmartin suggested, but no dice either.
Both of these work on iOS though.
@bradmartin, any other suggestions?
from nativescript-loading-indicator.
@sittaman to be able to get the modal by ViewChild where did you put the id "modal" ? And you saied android.view but what about IOS ?
from nativescript-loading-indicator.
@sittaman to be able to get the modal by ViewChild where did you put the id "modal" ? And you saied android.view but what about IOS ?
The id is the view (or modal) you want the loading to appear on top of. Or the one that is appearing over the loading.
<FlexboxLayout #modal class="nt-form" alignItems="center" height="100%" flexDirection="column">
As for iOS unfortunately I can't help, the app I was working on was android only and I have no means to test it on iOS, sorry.
from nativescript-loading-indicator.
Related Issues (20)
- Files missing after removing and adding plugin. HOT 4
- App crushes on show function HOT 2
- Loading-indicator never closes HOT 3
- Message and Details are not displayed on iOS HOT 6
- Mode: Indeterminate won't close in Android and iOS HOT 3
- Android is error, using Nativescript 6.0.0 HOT 8
- Android: Hide method does not work if navigation performed by Service. HOT 1
- Error building iOS: CDN: trunk URL couldn't be downloaded... HOT 5
- Error: Cannot find module '@nativescript/core/color' (CoreFoundation) *** Terminating app due to uncaught exception 'NativeScript encountered a fatal error: Error: Cannot find module '@nativescript/core/color'
- Cannot find name HOT 4
- Android layout-issue after calling application.off(application.orientationChangedEvent); HOT 1
- Long messages do not line break in iOS HOT 1
- Loading text not displaying HOT 1
- Android: loading-indicator and orientation change HOT 1
- {N} 7 Error creating Loading Indicator Pop Over: Cannot read property 'drawable' of undefined HOT 10
- Feature request: Add a delay option for showing the indicator
- Loader hides in iOS
- Android Issue : Error creating Loading Indicator Pop Over: Cannot read property 'android' of null
- JS: Error creating Loading Indicator Pop Over: Cannot read property 'getResources' of undefined HOT 1
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-loading-indicator.