nativescript

How to change TimePicker in NativeScript to show the time in 24-hour format?

巧了我就是萌 提交于 2019-12-08 13:24:49
问题 In NativeScript, there is the TimePicker, which one shows a time, but in 12-hour format. I have a problem, because in my database all of my times are saved in string (in format "23:59"). I canot set hour, e.g. 14. I have an idea, to convert string with split(':') and changing period AM to PM, but i cannot see any usefull method to do that. Please, help. 回答1: You can use the native APIs to set the 24-hour format. TimePicker in NativeScript is using UIDatePicker in iOS and android.widget

I have an issue with “history back” when navigate to same page

扶醉桌前 提交于 2019-12-08 07:36:28
When I navigate to the same component (with nativescript angular), I can intercept the params change but when i tap the Android Back button, it doesn't return back to previous page. constructor(private pageRoute: PageRoute) { super(); this.pageRoute.activatedRoute .switchMap(activatedRoute => activatedRoute.params) .forEach((params) => { this._groupId = params['id']; this.load(); // this method reload the list in the page. }); } I navigate in the same page "group/:id" with different url "home" -> "group/1" -> "group/2" -> "group/3". If I click Android Back Button in "group/3", I return to

How to reference 'this' inside an interface listener implemented with NativeScript?

走远了吗. 提交于 2019-12-08 07:23:18
问题 In Java, I have the documentation for the following code: import com.creator.creatorandroidsdk.terminal.DeviceSelectionListener import com.creator.creatorandroidsdk.TerminalListManager; public class ConfigPinPadActivity extends Activity implements DeviceSelectionListener { TerminalListManager terminalListManager; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); terminalListManager = new TerminalListManager(this,getApplicationContext());

Transparent tabbar and actionbar using angular nativescript for android and ios

◇◆丶佛笑我妖孽 提交于 2019-12-08 06:53:10
问题 I want to make the tab bar transparent and actionbar transparent over a swipelayout or page. The action or tab bar must sit on top of the page like in two layers I have tried using css to make transparent but its doesnt become transparent over the page. <ActionBar title="Name" backgroundColor="#00000000"></ActionBar> <TabView androidTabsPosition="bottom" selectedTabTextColor="white"> <page-router-outlet *tabItem="{iconSource: getIconSource('test')}" name="homeTab"> </page-router-outlet> <page

How can I migrate a web app with Angular v7 to mobile NativeScript app

空扰寡人 提交于 2019-12-08 06:45:44
问题 I made a simple web app with Angular v7 and I want to migrate it to a NativeScript mobile app . I followed the instructions in https://docs.nativescript.org/angular/code-sharing/migrating-a-web-project#migrating-components but I am facing a difficulty. The app is running in my Android mobile phone but it does not show the content because I need to adjust it properly for a mobile app. It shows auto-generated works. The problem is I do not know how I can do adjust properly the code since I

Nativescript angular : handle android back button on different pages

99封情书 提交于 2019-12-08 05:02:55
问题 So I use this function to handle android back button : this._page.on(Page.loadedEvent, event => { if (application.android) { application.android.on(application.AndroidApplication.activityBackPressedEvent, (args:AndroidActivityBackPressedEventData) => { args.cancel = true; this._ngZone.run(() => { this.router.navigate(['/parameters']); }); }); } }) on different pages (angular components). So on page1.ts I have navigate(['/parameters]) and on page2.ts I have console.log("test"). Problem is

Nativescript add tab into TabView dynamically - content disappears

和自甴很熟 提交于 2019-12-08 04:46:39
问题 I asked two days ago question about ListView but now I find out the core problem wasn't about listview but the problem was in TabView. On the start when It was created tabs everything looks fine but when I Tap on button which add another tab it doesn't work correctly. Tab is added (on the end) and selected index of tabs is 2 but content of previous tab (tab index 1) disappears. But when I go to last tab (index 3) and back to tab (index 1) content is there. Here is the code snippet where you

I have an issue with “history back” when navigate to same page

喜夏-厌秋 提交于 2019-12-08 04:26:41
问题 When I navigate to the same component (with nativescript angular), I can intercept the params change but when i tap the Android Back button, it doesn't return back to previous page. constructor(private pageRoute: PageRoute) { super(); this.pageRoute.activatedRoute .switchMap(activatedRoute => activatedRoute.params) .forEach((params) => { this._groupId = params['id']; this.load(); // this method reload the list in the page. }); } I navigate in the same page "group/:id" with different url "home

Prevent Angular NativeScript WebView from zooming with pinch zoom

别等时光非礼了梦想. 提交于 2019-12-08 03:45:08
问题 So I have a Nativescript App using Angular (NG 5.1.1 / Angular 7.x) I have a view with a webview. @ViewChild("myWebView") webViewRef: ElementRef; <WebView class="webview" #myWebView [src]="myURL"></WebView> Inside my webview.component.ts I have this. ngAfterViewInit(): void { const webview: WebView = this.webViewRef.nativeElement; webview.on(WebView.loadFinishedEvent, (args: LoadEventData) => { this.setIndicatorFalse(); if (webview.ios) { webview.ios.scrollView.delegate =

NativeScript Http Post Requests Blocked

风流意气都作罢 提交于 2019-12-08 03:43:33
问题 Trying to send a post request via https in Angular/Nativescript. I have tried post requests to our api as well as public apis and they all fail. In fact they don't fail because they don't show any errors, they just don't get executed at all. These post requests work in the Angular web app, and they work using Postman. It seems to be a problem with Nativescript or Android permission issue. 回答1: In apps targeting Android 9 or higher, the isCleartextTrafficPermitted() method returns false by