nativescript

NativeScript 之 ActionBar

本小妞迷上赌 提交于 2020-01-08 14:15:48
ActionBar ActionBar 是对Android ActionBar 和 iOS NavigationBar 的抽象 ActionBar是 像activity窗口顶端的工具栏这样的东西,可以导航,也可以自定义交互项。 ActionBar 提供了一个 title 属性,并且可以使用一个或多个扩展的 ActionItem 组件和单个 NavigationButton 。 <ActionBar title="ActionBar Title"> <NavigationButton icon="res://ic_arrow_back_black_24dp" (tap)="goBack()"></NavigationButton> <ActionItem icon="font://" class="fas" ios.position="right" (tap)="openSettings()"></ActionItem> </ActionBar> ActionItem 这些 ActionItem 组件支持特定于iOS和Android平台的 position 以及 systemIcon 。 <ActionBar title="Action Items"> <ActionItem (tap)="onShare()" ios.systemIcon="9" ios.position=

nativescript-google-maps-sdk use native calls to style the map

ⅰ亾dé卋堺 提交于 2020-01-07 09:33:28
问题 I successfully integrated a google map at my angular2+nativescript project. Everything I needed from the typescript definition file is working for me. However, I wanted to play around with the styling of the map. AFAIK, I have to use native calls to the map, as the method setMapStyle() is not in the typescript definition. I thought I could use the gMap property to access the native object and call the method. But I fail in setting up the right parameter as requested in google docs (https:/

nativescript-google-maps-sdk use native calls to style the map

风格不统一 提交于 2020-01-07 09:33:16
问题 I successfully integrated a google map at my angular2+nativescript project. Everything I needed from the typescript definition file is working for me. However, I wanted to play around with the styling of the map. AFAIK, I have to use native calls to the map, as the method setMapStyle() is not in the typescript definition. I thought I could use the gMap property to access the native object and call the method. But I fail in setting up the right parameter as requested in google docs (https:/

Why can't we use angular-fire2 package for firebase with Nativescript Angular app

安稳与你 提交于 2020-01-07 08:25:26
问题 If nativescript is using javascript engine behind the scene. If I use angular for nativescript development, shouldn't I be able to use angular-fire2 for firebase. if I could code sharing would be much better with Web and Mob App. 回答1: https://stackoverflow.com/a/46088932/6408287 contains the answer you are looking for. In short - NativeScript does not implement the node.js modules specification. Angular-fire2 is made to run inside node.js, whereas mobile firebase sdks are made to run on

Adding properties to an empty object

回眸只為那壹抹淺笑 提交于 2020-01-07 08:14:07
问题 I have this code var MY_OBJ = {}; MY_OBJ.test = function(){} and I'm using Vscode, I get property test not defined. How do I let this be just a warning. 回答1: This will fix your problem var MY_OBJ:any = {}; MY_OBJ.test = function(){} 回答2: Define your object to have a test property: var MY_OBJ: {test?: Function} = {}; MY_OBJ.test = function() { }; Or, set the property this way: MY_OBJ['test'] = function() { }; For further type-safety, define MY_OBJ to be an object: var MY_OBJ: { [propName:

Best practices to manage Debug and Release versions of an application using Nativescript?

混江龙づ霸主 提交于 2020-01-07 06:49:50
问题 I am developing a Nativescript application which makes numerous server calls for various services. The test and production URLs for these calls are different and while switching back and forth between the Debug and Release version I might miss or mess something up (by accidentally using a production URL for debug app). I wanted to know if there are any best practices regarding this aspect of App publishing? I couldn't find any specific answer regarding my question on the internet and the

Best practices to manage Debug and Release versions of an application using Nativescript?

心已入冬 提交于 2020-01-07 06:49:12
问题 I am developing a Nativescript application which makes numerous server calls for various services. The test and production URLs for these calls are different and while switching back and forth between the Debug and Release version I might miss or mess something up (by accidentally using a production URL for debug app). I wanted to know if there are any best practices regarding this aspect of App publishing? I couldn't find any specific answer regarding my question on the internet and the

NativeScript MaskedInput databinding

你离开我真会死。 提交于 2020-01-07 06:25:16
问题 I am trying to use the MaskedInput widget (https://github.com/bthurlow/nativescript-maskedinput) and I am having trouble getting the databinding to work. Here is my code: <mi:MaskedInput mask="999 999 9999" placeholder="_" text="{{ customer.homephone }}" color="#a8b4b9" /> The above snippet does not display the phone number initially. I am positive the customer.homephone has value in it because <TextField text="{{ customer.homephone, customer.homephone | phoneConverter() }}" class="value bold

How should I keep the status bar and actionbar hidden through navigation in Nativescript?

感情迁移 提交于 2020-01-07 04:42:05
问题 so currently I make an initial call to hide the status bar at the beginning of the app and also set the actionbar to hidden in the constructor of all my components, yet when I open the keyboard in android the status bar shows back up and doens't hide when the keyboard hides. How should I deal with this, especially given the fact that nativescript has no events for on keyboard open and close? I just need to maintain the status bar hidden after the keyboard closes (preferable always). To be

nativescript, angular2 and heaththkit - HKHealthStore not found;

允我心安 提交于 2020-01-07 04:36:11
问题 I am trying to follow the docs at https://github.com/NativeScript/sample-iOS-HealthKit which lets face it is poorly documented... tsk tsk tsk I have healthkit enabled in my xcode project. Per this sample https://github.com/NativeScript/sample-iOS-HealthKit/blob/master/app/components/main/main.ts file I am trying to import: var healthStore: HKHealthStore; cant find name HKHealthStore How to I import properly? Thanks 回答1: That sample 2 years old, from the very early days of NativeScript. Looks