nativescript

Sharing JSON data from server between 2 components

自作多情 提交于 2019-12-31 05:15:06
问题 I posted this yesterday but I have changed so much of the code today I have basically re-written my question: I have a NativeScript with Angular app using the TabView template and a login form using a modal window over the tabs initially and this appears to be working OK - the login form has no tabs and when logged in I am taken to the TabView. Upon successful login I want to call methods within the tabbed components and update the respective templates with content specific to the logged in

TabView vs SegmentedBar

守給你的承諾、 提交于 2019-12-31 04:41:06
问题 I am creating SegmentedBar in native script. I am able to create segments but I am not able to add Label to segment view. <Page xmlns="http://www.nativescript.org/tns.xsd" loaded="pageLoaded"> <StackLayout> <SegmentedBar> <SegmentedBar.items> <SegmentedBarItem title="Segment 1"> <SegmentedBarItem.view> <Label text=" I am in segment bar 1"/> </SegmentedBarItem.view> </SegmentedBarItem> <SegmentedBarItem title="Segment 2"> <SegmentedBarItem.view> <Label text=" I am in segment bar 2"/> <

How to use the native android widgets type definitions in nativescript?

不想你离开。 提交于 2019-12-31 04:24:08
问题 I installed the platform definitions by adding "tns-platform-declarations": "^2.5.2" However, when I use the definitions in tns-platform-declarations/android.d.ts I can't access certain parts of the API. For instance, I can't access android.support.design.widget.Snackbar private snackbar: android.support.design.widget.Snackbar; because 'android.support' has no exported member 'design' what am I missing? When I go to code complete, I get only 'android.v4' and v4 does not contain a "design"

NativeScript Telerik-UI using ListViewStaggeredLayout for images in RadListView

隐身守侯 提交于 2019-12-25 09:50:50
问题 I have a NativeScript/Angular2 app using Telerik-UI, when I try to display images using ListViewStaggeredLayout directive in a RadListView I get a blank page. Using same code to display text works OK, i.e. 2 columns and staggered layout. Using ListViewGridLayout to display images works as well. I have seen old Telerik documentation showing this is/was possible with images, but I cannot figure out what to set. The HTML code is below. Thanks. <RadListView [items]="pictures"> <template

Nativescript AutoComplete not visible

送分小仙女□ 提交于 2019-12-25 09:43:57
问题 Do any have the latest working solution for Autocomplete? I tried above steps but nothing is visible on screen Appreciate your answer and help! I tried this steps but nothing worked or visible on screen... The array of items: var item:Array<string> = ['1','2','3','4'] and in the HTML of the component: <StackLayout> <AutoComplete [items]="item" itemTap="itemTapped($event)"> </AutoComplete> </StackLayout> -Regards 回答1: I have been able to create something, It's not a plugin, just a piece of

Nativescript using custom icons on NavigationButton

时光总嘲笑我的痴心妄想 提交于 2019-12-25 09:30:14
问题 I'm trying to add a button with custom fonts on the ActionBar on a NativeScript Angular app. This is what I tried so far: <ActionBar class="cp-icon"> <NavigationButton text="" (tap)="goBack()"></NavigationButton> <Image src="res://logo_h_white"></Image> </ActionBar> // Or one of these optio <ActionItem text="" (tap)="goBack()"></ActionItem> <Label text=""></Label> <Button text=""></Button> But none of them seems to be working. I do have the font instaled because I can use in the view.

How to disable iOS console filtering out same messages?

孤人 提交于 2019-12-25 09:29:14
问题 I'm doing NativeScript work, using the iOS console. When I debug, I usually console.log(something) . However, subsequent triggers of the same event will be blocked on the console. According to https://docs.nativescript.org/angular/tutorial/ng-chapter-3 The iOS console will filter out similar messages and will show them only once. That is why when you keep on clicking the button, you will see hello only printed on the console once. Replace the string "hello" with the following back-tick string

Angular 2: when i change a variable in a promise.than in ngOnInit the view doesn't refresh

久未见 提交于 2019-12-25 09:15:58
问题 I created a short example of an Angular 2 application built with NativeScript , what I expect is the variable foo to be "foo" at the beginning, then the ngOnInit() first change it to "bar" and then the promise return and I should see "foobar" in the Label, but instead I see "bar". The execution is as expected as I can see in the logs: JS: afterBar JS: promise new JS: promise than component.ts foo:String="foo"; ngOnInit() { this.foo = "bar"; console.log("afterBar"); var promise = new Promise(

Adding view to NativeScript ActionBar breaks navigation

我的未来我决定 提交于 2019-12-25 08:36:03
问题 I'm trying to implement an <ActionBar> that starts off with a transparent background then, as the page is scrolled a background colour is faded in. I've made some progress with this by creating a new UIView and adding it to the navigationbar. Then setting the background colour on this view based on the current scroll position. Page: <Page xmlns="http://schemas.nativescript.org/tns.xsd" loaded="pageLoaded" backgroundSpanUnderStatusBar="true"> <Page.actionBar> <ActionBar title="Page two">

Renaming app name

两盒软妹~` 提交于 2019-12-25 08:34:28
问题 In my app - i'd like to rename my app for separate variations. For Android, can I rename the app_name resource at .\platforms\android\src\main\res\values\strings.xml Is that the right place? Ideally I would like the apk file to be the same - but I can rename that later. 回答1: Do you have the folder App_Resources under folder App ? If so, change the app name at .\app\App_Resources\Android\values\strings.xml . The one that you change in .\platform will get override by this one every time you