nativescript

How to display my location on Google Maps Nativescript

[亡魂溺海] 提交于 2019-12-13 22:25:57
问题 I'm using this plugin in my project. I want to show my location in map. In document I read in **UI Settings** myLocationButtonEnabled boolean - Whether the my-location button is enabled/disabled How to apply this in code? I try also to write this code: onMapReady(event) { this.mapView = event.object; var marker = new Marker(); marker.position = Position.positionFromLatLng(-33.86, 151.20); marker.userData = { index: 1 }; this.mapView.addMarker(marker); this.mapView.myLocationEnabled= true; }

NativeScript - Filter a ListView data by tabs from TabView-ng

会有一股神秘感。 提交于 2019-12-13 22:08:22
问题 How can I show up by demand only data related by specific room? Below my Json data: { "rooms": [ { "id": 1, "name": "Room 01", "content": "Content 01" }, { "id": 2, "name": "Room 02", "content": "Room 02" } ], "tables": [ { "id": 1, "number": 1, "roomId": 1 }, { "id": 2, "number": 2, "roomId": 1 }, { "id": 3, "number": 3, "roomId": 2 } ] } My template: <TabView [(ngModel)]="tabSelectedIndex" selectedColor="#FF0000"> <ng-container *ngFor="let tab of roomsList"> <StackLayout *tabItem="{title:

Unable to apply changes on device. Install fail even in simulator

为君一笑 提交于 2019-12-13 21:00:32
问题 My project run tns run ios --emulator fail after I update latest version and change cert and provision file. I looks up Console appliation when I run tns run ios on my real device, it show 0x16d55f000 -[MIInstaller _discoverInstallablesWithError:]: 610: No installable items found at /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.FlZEhJ/extracted/Payload . And before one week, it's build ok. The error is: Unable to apply changes on device: 1BADCC4A-CC22-4434-991F

TabView stick at the top on ios nativescript

会有一股神秘感。 提交于 2019-12-13 20:13:57
问题 I'm using tab-view show the data, but in android and IOS is different direction(android at top and IOS at bottom), how can I do ios same like android at the top ? Isn't got properties to set it? 回答1: In iOS is not possible to stick the tab-view at the top. you could use in the same way. SegmentedBar. I am giving you an example: main-page.xml <Page xmlns="http://schemas.nativescript.org/tns.xsd" navigatingTo="navigatingTo"> <StackLayout> <SegmentedBar selectedIndex="{{ selectedIndex }}">

Issues changing the background colour of the currently selected item in a ListView - Nativescript/Angular2

喜你入骨 提交于 2019-12-13 11:09:07
问题 I am busy with a Nativescript/Angular2 app where I display a list of active stock takes in a ListView. I am trying to change the background color lf the current selected stock take item in the ListView to show the currently selected StockTake. I add the css class to the StackLayout inside the ng-template but for some reason the css isn't applied when I tap on a item. Any idea what could be going wrong here/how I can fix this? I don't get any errors so i'm completely lost as to what the issue

nativescript-background-http upload file to php

孤街浪徒 提交于 2019-12-13 08:49:17
问题 I want to upload audio file on my server using nativescript-background-http plugin. The mobile side is working fine. no runtime error. The log shows complete upload but when I visit the directory on my server, no file is uploaded. Here's my code on nativescript var session = bghttp.session("image-upload"); var audioFolder = fs.knownFolders.documents().getFolder("audio"); var recordedFile = audioFolder.getFile("recording.mp3"); var request = { url: "http://talktext.me/talktext.me(app)/recAudio

How to access the UIPrintInteractionController class with NativeScript

僤鯓⒐⒋嵵緔 提交于 2019-12-13 07:37:20
问题 I'm trying to implement AirPrint printing and need to instantiate UIPrintInteractionController . However, I can't seem to get it to find the class. How can I access this UIKit class from NativeScript? function findPrinter() { var printController = UIPrintInteractionController.new(); console.log(printController); } exports.findPrinter = findPrinter; 回答1: Use the following syntax for your case : function findPrinter() { var printController = UIPrintInteractionController; console.log

Dragging and Dropping in NativeScript

纵饮孤独 提交于 2019-12-13 07:22:28
问题 I am considering NativeScript for a new project where a user drags something (a label or image) to one of three areas of the screen. Kind of like sorting where entity A goes in bucket 1, 2, or 3. I am thinking something along the lines of the following poorly drawn concept: A 1 2 3 Where A is the object, and 1, 2, and 3 are boxes (or bins) and the user drags the A to one of the buckets. In the web app I am working on, I accomplish this using ngDraggable, but I was not sure if it could be done

Unhanded Exception thrown following Nativescript 2.2.0 update

限于喜欢 提交于 2019-12-13 06:59:48
问题 I just updated to Nativescript 2.2.0, everything built fine and runs fine through most of my app. When loading a specific view though I get the below unhandled exception along with the stack trace. This was not occuring before updating the core platform and modules. When I search for the 'disableNotifications' property mentioned in the stack trace I find nothing of the sort in my project. After doing some digging seems to be apart of the core framework some where, any body have any ideas?

How to use httpClient using get method when token set in the header

自闭症网瘾萝莉.ら 提交于 2019-12-13 06:10:34
问题 In this post I get correct answer for problem. Now I want to use it in get method and I want to send also in header token. I modify it like below: public detailsuser(): Observable<Users[]> { let headers = new Headers(); headers.append('Content-Type', 'application/json'); headers.append('X-Token', this.currentUser.token); return this.http.get(Api.getUrl(Api.URLS.details), { headers: headers },{ observe: 'response' }) .pipe(map((response: HttpResponse<any>) => { console.log('response', response