标签: nativescript

NativeScript:Android 上未加载字体系列

我导入了一组 Galano Grotesque xxx.otf 字体文件(xxx=Alt Black、Alt Black Bold 等),它在 iOS 上就像一个魅力,但在 Android 上却不然。当我在 Android 上运行该应用程序时,字体未加载。

我正在使用这个:

Label {
    font-family: "Galano Grotesque";
    color: #5b5b5f;
}
Run Code Online (Sandbox Code Playgroud)

我发现这篇文章 - Android Not Showing Font Icon In NativeScript - 我尝试了这个

Label {
    font-family: "Galano Grotesque", galano grotesque;
    color: #5b5b5f;
}
Run Code Online (Sandbox Code Playgroud)

但没有成功:(

有人知道我能做什么来解决它吗?

谢谢

css fonts android nativescript

3
推荐指数
1
解决办法
1789
查看次数

Typescript 类中对“this”的未定义引用

我在使用 Typescript 时遇到问题,其中this关键字在调试时显示为未定义,因此不调用从回调方法调用的一些私有类方法。我的文本编辑器似乎认为我的参考文献很好并且给了我智能感知,所以我假设代码没问题。下面是一个简短的示例。调用回调方法时cacheUser, 和不会_processSuccessfulRegistration被命中。_handleCreationResponse

export class User extends Observable {
    public email: string;
    public password: string;
    public username: string

    constructor() {
        super()
        this.email = '';
        this.password = '';
        this.username = '';
    }

    public register() {
        let user = {
            // build out object
        }
        userService.createAccount(user)
            .catch(/* handle error */)
            .then(this._handleCreationResponse)
    }

    private _handleCreationResponse(response) {
        let status = response.status;
        let userData = response.result;

        switch (status) {
            case ApiStatus.Success:
                this._cacheUser(userData);
                this._processSuccessfulRegistration(userData);
                break;
            case ApiStatus.SomeError:
                // …
Run Code Online (Sandbox Code Playgroud)

typescript nativescript

3
推荐指数
1
解决办法
3161
查看次数

Nativescript API 级别

我使用 Nativescript 框架构建了一个 Android 应用程序,我尝试将我的 SDK 上传到 Play 商店,但收到以下错误

您的应用程序目前的目标是 API 级别 25,并且必须至少针对 API 级别 26,以确保它基于针对安全性和性能进行优化的最新 API 构建。将应用程序的目标 API 级别更改为至少 26。

我已经更改了 AndroidManifest.xml 中的 API LEVEL,但这似乎不起作用,我该如何解决这个问题。

android nativescript

3
推荐指数
1
解决办法
2483
查看次数

Nativescript + Angular,如何到达嵌套页面路由器出口中的子路由?

我想在 NS + Angular 7 应用程序中实现选项卡视图导航。

这是我当前的设置:

应用程序路由.module.ts:

...

const routes: Routes = [
    { path: '', redirectTo: '/login', pathMatch: 'full' },
    { path: 'login', component: LoginComponent },
    { path: 'tabs', loadChildren: '~/app/tabs/tabs.module#TabsModule'; }
];

...
Run Code Online (Sandbox Code Playgroud)

tabs.module.ts:

...
NativeScriptRouterModule.forChild([
            {   path: 'def',
                component: TabsComponent,
                children: [
                  {
                      path: 'market',
                      outlet: 'market',
                      component: NSEmptyOutletComponent,
                      loadChildren: '~/app/market/market.module#MarketModule'
                  },
                  {
                      path: 'list',
                      outlet: 'list',
                      component: NSEmptyOutletComponent,
                      loadChildren: '~/app/list/list.module#ListModule'
                  },
                  {
                      path: 'search',
                      outlet: 'search',
                      component: NSEmptyOutletComponent,
                      loadChildren: '~/app/search/search.module#SearchModule'
                  },
                  {
                      path: 'insight',
                      outlet: …
Run Code Online (Sandbox Code Playgroud)

javascript angular-routing nativescript angular

3
推荐指数
1
解决办法
2352
查看次数

NativeScript for Windows 错误:Android SDK Build-tools v29 您可以安装以下范围内的任何版本:'>=23 <=28'

当尝试在 2019 年 6 月遵循 NativeScript for Vue 快速入门:https://nativescript-vue.org/en/docs/getting-started/quick-start/ 时,Android SDK 版本为 29。

在命令$ tns run android --bundle或运行时tns doctor,我收到以下错误:You need to have the Android SDK Build-tools installed on your system. You can install any version in the following range: '>=23 <=28'是的,我也收到消息Your ANDROID_HOME environment variable is set and points to correct directory.,但当然它是版本 29,而不是'>=23 <=28'

其他 SO 响应似乎没有解决这个问题。

在这种情况下如何安装旧版本?

nativescript nativescript-vue

3
推荐指数
1
解决办法
1387
查看次数

奇怪的消息:xcodebuild[14933:1513031] DVTPortal:服务 - 在 tns 上运行 ios

$tns run ios
Run Code Online (Sandbox Code Playgroud)

我有一个有趣的说法,我的会话已过期,为什么如果我没有使用我所知的developerservices2.apple.com 中的任何内容?

Pod installation complete! There are 2 dependencies from the Podfile and 6 total pods installed.
Project successfully prepared (ios)
Building project...
Xcode build...
2020-02-25 17:25:15.195 xcodebuild[14933:1513031]  DVTPortal: Service '<DVTPortalViewDeveloperService: 0x7ff1dad949c0; action='viewDeveloper'>' encountered an unexpected result code from the portal ('1100')
2020-02-25 17:25:15.195 xcodebuild[14933:1513031]  DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired.  Please log in." UserInfo={payload={
    creationTimestamp = "2020-02-25T17:25:15Z";
    httpCode = 200;
    protocolVersion = QH65B2;
    requestUrl = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action";
    responseId = "2db7642e-2968-41e4-b622-a343370951c9";
    resultCode = 1100; …
Run Code Online (Sandbox Code Playgroud)

mobile ios nativescript

3
推荐指数
1
解决办法
2375
查看次数

NativeScript-vue:无法在WebView中显示本地HTML

我正在使用 NativeScript-vue。

我想使用 WebView 在本地资源中显示 HTML 文件。

src/components/App.vue:

<template>
  <Frame>
    <Page>
      <GridLayout columns="*" rows="*">
        <WebView row="0" col="0" src="~/assets/index.html" />
      </GridLayout>
    </Page>
  </Frame>
</template>
Run Code Online (Sandbox Code Playgroud)

src/main.ts:

import Vue from 'nativescript-vue';
import App from './components/App.vue';

new Vue({
  render: h => h(App)
}).$start();
Run Code Online (Sandbox Code Playgroud)

src/assets/index.html:

<html>
  <body>
    <div>test</div>
  </body>
</html>
Run Code Online (Sandbox Code Playgroud)

App_Resources/Android/src/main/AndroidManifest.xml:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="__PACKAGE__"
    android:versionCode="10000"
    android:versionName="1.0">

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"/>

    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
    <uses-permission android:name="android.permission.INTERNET"/>

    <application
        android:name="com.tns.NativeScriptApplication"
        android:allowBackup="true"
        android:icon="@drawable/icon"
        android:label="@string/app_name"
        android:theme="@style/AppTheme"
        android:usesCleartextTraffic="true">

        <activity
            android:name="com.tns.NativeScriptActivity"
            android:label="@string/title_activity_kimera"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize|smallestScreenSize|screenLayout|locale|uiMode" …
Run Code Online (Sandbox Code Playgroud)

android vue.js nativescript nativescript-vue

3
推荐指数
1
解决办法
1003
查看次数

为什么 ns doctor android 有问题?

\xe2\x9c\x94 Your ANDROID_HOME environment variable is set and points to correct directory.\n\xe2\x9c\x94 Your adb from the Android SDK is correctly installed.\n\xe2\x9c\x94 The Android SDK is installed.\n\xe2\x9c\x94 A compatible Android SDK for compilation is found.\n\xe2\x9c\x94 Javac is installed and is configured properly.\n\xe2\x9c\x94 The Java Development Kit (JDK) is installed and is configured properly.\n\xe2\x9c\x94 Getting NativeScript components versions information...\n\xe2\x9c\x94 Component nativescript has 8.1.4 version and is up to date.\n\xe2\x9c\x94 Component @nativescript/core has 8.1.5 version and is up to date.\n\xe2\x9c\x96 Component @nativescript/android is …
Run Code Online (Sandbox Code Playgroud)

android nativescript

3
推荐指数
1
解决办法
806
查看次数

如何使用Nativescript中的滑动手势实现页面之间的导航

我想在页面之间实现导航,就像通过向左或向右滑动TabView一样.但是,对于页面级别或跨越整个屏幕的布局,似乎不会触发滑动手势.TabView本身没有用,因为我有一大堆用户可以滚动的项目,我不需要在屏幕上显示一堆标签.

有谁知道如何在Nativescript中实现它?

navigation swipe nativescript

2
推荐指数
1
解决办法
2899
查看次数

Nativescript自定义组件

我按照本指南创建了一个nativescript自定义组件http://moduscreate.com/custom-components-in-nativescript/但它对我不起作用

我有一个文件夹页面,里面有一个名为main的文件夹. main有几个文件

main.html中

<StackLayout 
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:hello="pages/helllo"
loaded="pageLoaded" >
  <hello:hello/>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)

main.component.ts

import { Component, ElementRef, OnInit, ViewChild} from "@angular/core";
import { Page } from "ui/page";
import colorModule = require("color");
var Color = colorModule.Color;
@Component({
selector: "my-app",
templateUrl: "pages/main/main.html",
styleUrls: ["pages/main/main-common.css"]
})    
export class MainComponent implements OnInit{
      constructor(private page: Page) {
  }    

  ngOnInit() {
    this.page.actionBarHidden = true;
 }  
} 
Run Code Online (Sandbox Code Playgroud)

而且我也有main-common.css,但这并不重要.然后我在页面中有另一个名为hello的文件夹,里面只有一个文件

hello.html的

<StackLayout width="100%" height="100%" backgroundColorr="red">
  <Label class …
Run Code Online (Sandbox Code Playgroud)

android typescript nativescript angular

2
推荐指数
1
解决办法
1526
查看次数