nativescript

Use Nativescript Core plugin in Nativescript Angular project

一个人想着一个人 提交于 2019-12-13 04:45:55
问题 I am using in my Nativescript Angular app the nativescript-google-maps-sdk plugin which works great. My issue is that I want to use cached images to display in a custom InfoWindow. For this purpose I am using the nativescript-web-image-cache plugin app-wide. When I use the regular <WebImage> tag in the infoWindow it complains that it is not a registered component: Module 'ui/web-image' not found for element 'WebImage' Everywhere else in the app it works just fine. In this issue is it

How to create a custom navigation bar in NativeScript?

五迷三道 提交于 2019-12-13 04:27:20
问题 I am new to NativeScript and experimenting with it a little via the playground. There are some UIs that i'd like to implement and don't see samples of and I was wondering what would it take to implement? specifically, I'd like to create a bottom navigation such as below, with the middle button. 回答1: Here is a pseudocode gives you the layout you are looking for. <GridLayout> <GridLayout rows="*,auto"> <StackLayout row="0" backgroundColor="#ccc"> <Label text="Your Content" fontSize="30"

Nativescript iOS Action Bar Subtitle

℡╲_俬逩灬. 提交于 2019-12-13 04:16:26
问题 I'm attempting to put a subtitle under a title in the action bar on iOS. While there is this solution for Android it doesn't work on iOS at all. Is there any way to do this on iOS? <ActionBar [title]="This works" [subTitle]="I want a subtitle here"></ActionBar> 回答1: iOS doesn't have a subtitle option. But you could use a custom title view and wrap two labels one below another. 回答2: iOS has some sort of subtitle, but it is named as prompt (for more detail, you can see the doc for

nativescript 5.1 and tns_modules folder in IOS build

北战南征 提交于 2019-12-13 03:56:37
问题 I had this issue before with some app (N 4.1). Now i'm doing another app, and i have the same issue : First, im preparing build: tns build ios --for-device --release --provision MY_Provision Nativescript is doing build, so next i'm opening it in XCode, and doing some twaks like version number etc... Lastly i'm doing "Archieve" and trying to Validate this archieve. The result is error, in the previous app written in N 4.1 i had the same but with another plugin, and now validation throws:

Opening a native settings menu page programmatically in NativeScript

空扰寡人 提交于 2019-12-13 03:54:58
问题 How can you programmatically open a page from the native Android settings menu using NativeScript? Classic java examples show it can be done this way: Intent intent = new Intent(Settings.ACTION_SETTINGS); startActivity(intent); but how to do the same in NativeScript? 回答1: This can be achieved using the module tns-core-modules/application , which will make startActivity available. An example using TypeScript is provided below: import * as appM from 'tns-core-modules/application'; const intent

Cannot find any tns-core-module/ui Modules NativeScript

心不动则不痛 提交于 2019-12-13 03:51:23
问题 I am writing a {N}-Application and need to import Images from the tns-core-modules/ui/image -module. Sadly he says that he cannot find that target in the tns-core-module. My code: import * as ImageModule from "tns-core-module/ui/image"; What am I supposed to do now? How can I fix this? My npm --version : 3.10.10 My node -v : v6.11.1 My TS-Version: 2.4.2 The tns-core-modules are Version 2.2.1 in my package.json 回答1: Are you sure that the path you provided is valid? It seems like you want to

Animating height property

烂漫一生 提交于 2019-12-13 03:49:19
问题 Hello there stackoverflow and nativescript users! I have a problem with animating a view. What I want: I am trying to create a view where you can click and it opens op a new view below animated pushing all other views further down. Problem: Only the elements inside are animated or nothing is animated at all. What I tried: I tried using the nativescript UI Animations but without success because the height property is not supported. My version: https://gyazo.com/130c2b3467656bcc104c9b8e2c860d94

Nativescript - Error: more than one library with package name (Android)

烈酒焚心 提交于 2019-12-13 03:47:18
问题 I'm getting the following error when I build under Android Error: more than one library with package name 'com.google.android.gms.license' How can I fix this? I understand this has to do with some incompatibility with Android sdk library - but I didn't update anything explicitly - are libs being auto updated in the background? 回答1: If your tns-android version is 4+ then you can try with tns platform add android@3.4 It worked for me. 来源: https://stackoverflow.com/questions/49417231

Is it possible to inject javascript in webview

一世执手 提交于 2019-12-13 03:46:08
问题 Is it possible to inject javascript into a third party web-page - i'm trying to pre-fill some INPUT fields. I've got a feeling the answer will be no - but maybe possible in native code. Looking at the ios code for WebView - I see that the constructor actually injects it's own JS code. Just wondering how I could also do the same. I tried to inject during the loadFinishedEvent - but I think it's too late. Maybe I need to sub-class Webview - how would I do that and also be able to specify the

Nativescript unable to get values of Textfield element using angular 6

馋奶兔 提交于 2019-12-13 03:45:04
问题 NativeScript version 4.2.4 Angular version 6.0 I have two TextFields in my login page <StackLayout class="input-field"> <TextField class="input" hint="Username" autocorrect="false" autocapitalizationType="none" [(ngModel)]="user.userName" returnKeyType="next" (returnPress)="focusPassword()"></TextField> <StackLayout class="hr-light"></StackLayout> </StackLayout> <StackLayout class="input-field"> <TextField #password class="input" hint="Password" secure="true" [(ngModel)]="user.password"