标签: nativescript

nativescript |layouts 为 ngFor 循环创建 ui

,我尝试创建一个视图并且遇到了麻烦。我试图用 ngFor 创建一行图像,所以我不知道将在屏幕上显示的图像的执行数量,但需要它看起来像那样,如果有 3 张照片,它将在一行中,但是当第四张照片时图像将被添加,它将下降到一个新行在此处输入图片说明

谢谢你

nativescript angular2-nativescript nativescript-telerik-ui nativescript-angular

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

× 组件 tns-core-modules 未安装。× 组件 tns-android 未安装。× 组件 tns-ios 未安装

我错过了什么,我已经完成了运行 tns 医生的nativescript安装指南中要求的所有步骤,给了我以下输出...

C:\abc\xyz>tns doctor
? Getting environment information

? Your ANDROID_HOME environment variable is set and points to correct directory.
? Your adb from the Android SDK is correctly installed.
? The Android SDK is installed.
? A compatible Android SDK for compilation is found.
? Javac is installed and is configured properly.
? The Java Development Kit (JDK) is installed and is configured properly.
? Local builds for iOS can be executed only on a macOS …
Run Code Online (Sandbox Code Playgroud)

android tns nativescript

3
推荐指数
2
解决办法
4023
查看次数

无法在平台 iOS NativeScript 中添加自定义字体

我已按照官方文档中的指南向我的本机脚本应用程序添加自定义字体。https://docs.nativescript.org/ui/styling#custom-fonts

字体名称是 Ubuntu,如下图所示。 在此处输入图片说明

我在我的项目的文件夹 /fonts 下添加了字体 Ubuntu.ttf,并将以下内容添加到我的 app.css 文件中:

在此处输入图片说明

.Ubuntu
{
    font-family: Ubuntu;
}
Run Code Online (Sandbox Code Playgroud)

但是,一旦对应用程序进行分层,我就看不到应用于我的标签的字体。

<Label class="Ubuntu" text="This is a test message" ></Label>
Run Code Online (Sandbox Code Playgroud)

任何帮助将不胜感激。

nativescript

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

React Native、Ionic、Flutter 和 NativeScript 中的代码可重用性(一次编写,随处使用)

这是我第一次在这里写这样的问题,所以如果我的问题不好请见谅。

我正在学习一些新的跨平台框架。我对Ionic(第 4 版)、Flutter、React Native 和NativeScript很感兴趣。确切地说,我想了解每个框架的代码可重用性概念。他们如何应用可重用性?在哪个矩阵中,后果是什么?

谢谢。

cross-platform ionic-framework nativescript react-native flutter

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

Angular Nativescript 如何修复 ng gc 上的错误?

不久之前,我使用 angular - nativescript 创建了项目。我只使用了文档中的命令,安装后我试图运行这个命令:

ng generate component home 
Run Code Online (Sandbox Code Playgroud)

我收到此错误:

发生未处理的异常:找不到模块 '@schematics/angular/utility/parse-name' 有关更多详细信息,请参阅“C:\Users\andri\AppData\Local\Temp\ng-JFv0M5\angular-errors.log”。

更多细节 :

[错误] 错误:在 Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15) at Function.Module._load (internal/ modules/cjs/loader.js:508:25) at Module.require (internal/modules/cjs/loader.js:637:17) at require (internal/modules/cjs/helpers.js:22:18) at Object . (C:\Users\andri\AppData\Roaming\npm\node_modules@nativescript\schematics\src\generate\component\index.js:6:22) 在 Module._compile (internal/modules/cjs/loader.js:701) :30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10) at Module.load (internal/modules/cjs/loader.js:600:32) at tryModuleLoad (internal /modules/cjs/loader.js:539:12) 在 Function.Module._load (internal/modules/cjs/loader.js:531:3)

我该如何解决 ?

我的信息:

? Component nativescript has 6.0.3 version and is up to date.
? Component tns-core-modules has 6.0.7 version and is up to date.
? Component tns-android has 6.0.2 …
Run Code Online (Sandbox Code Playgroud)

nativescript angular

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

无法在 NativeScript 中使用字体图标

我已经从 fontello 下载了一个 tff 图标 - 我discard将其重命名为- 并将其放置在vanilla ts nativescript 项目fonts文件夹内的app文件夹中:

在此处输入图片说明

在我的 xml 我有这个标签:

<Label id="label" text="1U+F1F8" class="discard" />
Run Code Online (Sandbox Code Playgroud)

而app.css像这样:

.btn {
    font-size: 18;
}

.discard {
    font-family: "discard";
    font-weight: bold;
}
Run Code Online (Sandbox Code Playgroud)

标签显示文本时应该显示图标?

在此处输入图片说明

文本是tff 文件的unicode,我认为这是文档中所见的要求- 从 Mac 上的字体手册中获取:

在此处输入图片说明

到目前为止,我也只在 android 上尝试过 - 因为我只需要正确设置文件名。

可能是什么问题?

我在我的原始项目中使用 react-nativescript - 但希望首先让它在 vanilla ts 中工作。最好有一种方法可以在后面的代码中做到这一点,然后我可以在 react-nativescript 中使用它。

css fonts nativescript

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

服务通知的无效渠道:通知

只要我使用 Android Emulator 来测试我的代码就可以正常工作,但是一旦我构建它并尝试在我的手机上使用它,我就会收到以下错误:

    An uncaught Exception occurred on "main" thread.
Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=channel_01 pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)

StackTrace:
android.app.RemoteServiceException: Bad notification for startForeground: java.lang.RuntimeException: invalid channel for service notification: Notification(channel=channel_01 pri=0 contentView=null vibrate=null sound=null defaults=0x0 flags=0x40 color=0x00000000 vis=PRIVATE)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1760)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:201)
    at android.app.ActivityThread.main(ActivityThread.java:6806)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
Run Code Online (Sandbox Code Playgroud)

这是我的代码:

@JavaProxy('org.nativescript.nstestandroid.ForegroundService')
class ForegroundService extends android.app.Service {
    onStartCommand(intent, flags, startId) {
        console.log('onStartCommand');
        super.onStartCommand(intent, flags, …
Run Code Online (Sandbox Code Playgroud)

android nativescript angular

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

带有淡入淡出效果的 UIScrollView 与 nativescript vuejs

我想知道是否可以使用带有淡入淡出效果的 UIScrollView 与 nativescript 请?

例如:https : //medium.com/@luisfmachado/uiscrollview-with-fade-effect-246e332e8b24

我阅读了文档https://nativescript-vue.org/en/docs/elements/components/scroll-view/,但我没有找到这些信息。

我想要这个结果,例如:

在此处输入图片说明

你有什么想法吗?谢谢

我不知道如何将本机代码放入我的组件中

<template>
    <ScrollView class="scroll" orientation="vertical" row="1" ref="scrollView">
        <StackLayout marginLeft="10" marginRight="10" class="container-verses">
            <StackLayout horizontalAlignment="center">
                <Label textWrap="true" textAlignment="center" text="hello" color="#FFFFFF" fontSize="20"/>
                ...
                <Label textWrap="true" textAlignment="center" text="hello" color="#FFFFFF" fontSize="20"/>
            </StackLayout>
        </StackLayout>
    </ScrollView>
</template>

<script>
    export default {
        name    : 'FadeScrollView',
        computed: {},
        methods : {
            //
        }
    };
</script>

<style lang='scss' scoped>

</style>
Run Code Online (Sandbox Code Playgroud)

nativescript nativescript-vue

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

无法打开开发工具

通过 angular 使用 nativescript 时,我无法通过 url 打开 chrome dev-tools:

chrome-devtools://devtools/bundled/inspector.html?experiments=true&ws=localhost:40000

但是当复制链接并粘贴到谷歌浏览器时,结果只是搜索

我试图重新安装谷歌浏览器。删除 node_modules 文件夹、package-lock 文件,然后重新安装 npm。但无法解决问题

nativescript

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

错误:找不到模块 nativescript-angular/router 或其相应的类型声明

阅读本机脚本文档并观看我想使用的视频,RouterExtensions但出现以下错误:

cannot find module nativescript-angular/router or its corresponding type declarations
Run Code Online (Sandbox Code Playgroud)

我的代码

cannot find module nativescript-angular/router or its corresponding type declarations
Run Code Online (Sandbox Code Playgroud)

屏幕错误

nativescript angular

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