nativescript

How to get elementById in Nativescript?

我与影子孤独终老i 提交于 2021-02-04 18:56:35
问题 I'm using nativescript with vue.js and I'm trying to do something like DOM operation. This is sample code from my template: <Label textWrap="true"> <FormattedString id="formString" backgroundColor="yellow" effectiveHeight="100" effectiveWidth="100%"> <Span text="This text has a " /> </FormattedString> </Label> I want to get tag element FormattedString by his id - formString In javascript is like this: let fs = doument.getElementById('formString'); How can I do this in Nativescript-Vue? I know

How to get elementById in Nativescript?

£可爱£侵袭症+ 提交于 2021-02-04 18:56:11
问题 I'm using nativescript with vue.js and I'm trying to do something like DOM operation. This is sample code from my template: <Label textWrap="true"> <FormattedString id="formString" backgroundColor="yellow" effectiveHeight="100" effectiveWidth="100%"> <Span text="This text has a " /> </FormattedString> </Label> I want to get tag element FormattedString by his id - formString In javascript is like this: let fs = doument.getElementById('formString'); How can I do this in Nativescript-Vue? I know

NativeScript angular nativeView undefined

旧时模样 提交于 2021-01-29 21:40:44
问题 I am trying to get StackLayout nativeView from NativeScript Angular but always returning undefined . I tried like this: html: <StackLayout id="stackLayout" #stackLayout> </StackLayout> TS: ngAfterViewInit() { setTimeout(() => { let container: StackLayout = this.page.getViewById("stackLayout"); console.log(container.nativeView); console.log(this.stackLayout.nativeElement.nativeView); }, 100) } Please give me suggestion. 回答1: Use the loaded event of the View itself which ensures the nativeView

Custom transition using pan gesture on nativescript core

[亡魂溺海] 提交于 2021-01-29 21:34:44
问题 Is it possible to achieve the page transition shown in the image below using nativescript core? As you can see, to make the transition from one view to the previous (parent) one, I'm making a pan gesture slowly and depending on where my finger horizontally is, the view is being shown and coming into existence from left. You can't see the finger but you can see the slow transition controlled by my finger. I'm making a pan gesture from very left of screen to the right. The transitions that I've

AllowFullScreen in webview nativescript (angular)

时光总嘲笑我的痴心妄想 提交于 2021-01-29 19:08:42
问题 developing the webview I have run into the following problem: I can not make a fullscreen of an element or video. https://play.nativescript.org/?_ga=2.219824793.1845577720.1550136156-465475599.1539966593&template=play-ng&id=RDivWd&v=3 I have tried the following solutions: https://bradmartin.net/2016/01/25/videos-in-a-nativescript-app/ Embedded YouTube videos in Html/WebView in NativeScript iOS 回答1: This is the method I use to make any app go full screen. I don't know if it can help you.

NativeScript WebView not loading html file

送分小仙女□ 提交于 2021-01-29 18:44:50
问题 Trying to load a local HTML file into webview in my native-script (typescript) application. It's not loading but shows an error. <WebView src="~/assets/content.html" /> The requested URL was not found on this server. 回答1: You have to pass the absolute URL or you can try the following. import * as fs from "tns-core-modules/file-system"; public webViewSRC: string = encodeURI(`${fs.knownFolders.currentApp().path}/assets/content.html`); and in your html <WebView [src]="webViewSRC"></WebView> 来源:

nativescript fails to run with an exit code of 0

风流意气都作罢 提交于 2021-01-29 17:53:57
问题 I've started having problems getting nativescript to run, and the error message is truly confusing, since it is exit code 0. tns run android Searching for devices... NativeScript Environment: tns run <platform> --env not provided. NativeScript Environment: Environment vars not changed Preparing project... File change detected. Starting incremental webpack compilation... webpack is watching the files… Executing webpack failed with exit code 0. I've tried the usual suspect list of remedies:

ERROR in The target entry-point “@nativescript/angular” has missing dependencies on running a Nativescript Angular 9 project

感情迁移 提交于 2021-01-29 16:42:42
问题 I am receiving an error for a working Nativescript Angular 9 project which we started 2 weeks back . The error is like this : ERROR in The target entry-point "@nativescript/angular" has missing dependencies: - @nativescript/core/ui/layouts/layout-base We are working on a sharing code base which we were able to run both web code and native code simultaneously without any issues till last day. Today when i tried running the project for web application, i am getting this error. On googling , got

Getting JS promise to return a value

江枫思渺然 提交于 2021-01-29 16:18:24
问题 I have been looking thru many excellent online examples of getting a Promise to return a value in the .then(). However, there must be something different in my example that is blocking it. I am using nativescript-vue if that makes a difference, but really I think this is a Javascript question. I have calling vue file: var person; personService.retrievePerson(this.id).then(function(val) { console.log("===> received val: " + val); person = val; }).catch(function(err) { console.err(err); let

back button in android breaks nativescript-vue access control login logout

落花浮王杯 提交于 2021-01-29 10:30:02
问题 I have come up with an implementation of access control for a nativescript app but the android back button breaks it. Scenario: Open the app press login press back button in android (The app will be minimized) Open the app again (you are supposed to see that you are logged in but you see that you appear to be logged out) Now actually close the app Open the app again (You will see that you were actually logged in but the app was displaying the wrong page for you) How can I fix this issue? What