标签: nativescript

是否有与 Nativescript 上的 HTML 锚标记等效的内容?

我正在尝试显示带有链接(例如 HTML<a>锚标记)的简单图像或文本

  <ListView [items]="items | async" (itemTap)="onItemTap($event)">
    <template let-item="item">
      <StackLayout>
        <Image [src]="item.imageUrl" ></Image> 
 <!--<Image [src]="item.imageUrl" href="http://google.com"></Image>-->
      </StackLayout>
    </template>
  </ListView>
Run Code Online (Sandbox Code Playgroud)

似乎唯一的选择是使用 onItemTap 并获取项目 url 并手动设置要在单独的 webview 上显示的 url 内容。是否有任何标签会自动在手机上打开一个单独的浏览器页面并显示项目的 URL 内容?

html javascript nativescript angular2-nativescript angular

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

Textarea 或 textbox 组件在带角度的 nativescript 中是否可用?

我想从用户那里获得作为段落(如用户地址)的输入。为此,我正在寻找 nativescript 中的 UI 组件。如果我使用文本字段,是否有任何字符限制。或者我应该在这种情况下使用文本字段。

nativescript angular2-nativescript

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

iOS 如何使用 nativescript-audio 插件播放网络广播流?

我正在nativescript开发一个网络广播应用程序和 nativescript-audio插件来读取流。在 Android 上我没有问题,但在iOS方法上:

sharedSession.dataTaskWithUrlCompletionHandler(URL, function(data, response, error)) 返回错误 = {}

这是我的Info.plist 的一部分

<dict>
    <key>NSAllowsArbitraryLoads</key>
    <true/>
    <key>NSExceptionDomains</key>
    <dict>
	    <key>radioking.com</key>
		<dict>
    		<key>NSIncludesSubdomains</key>
	    	<true/>
		    <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
			<true/>
    		<key>NSTemporaryExceptionMinimumTLSVersion</key>
	    	<string>TLSv1.1</string>
		</dict>
    </dict>
</dict>
Run Code Online (Sandbox Code Playgroud)

这是我的网址:https : //www.radioking.com/play/jobradio 流格式为 mp3

插件调用:

private player  = new TNSPlayer();

public initFromUrl(url : string, autoPlay : boolean = false) {
    // Initialize player
    this.player.initFromUrl({
        audioFile: url,
        loop: false,
        completeCallback: () => {
            this.player.dispose().then(() => { });
        },
        errorCallback: args => { }, …
Run Code Online (Sandbox Code Playgroud)

ios nativescript

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

如何在启动屏幕中为徽标添加填充?

期望的结果

我想在两侧的徽标中添加填充或空格,并在此处添加代码。

<layer-list xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="fill">
        <item android:drawable="@color/ns_theme"></item>
    <item>
        <bitmap android:gravity="center" android:src="@drawable/logo" />
    </item>
</layer-list>
Run Code Online (Sandbox Code Playgroud)

在此处输入图片说明

android pinterest nativescript

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

获取元素当前位置?

有没有办法获取元素的当前位置?它是 x 和 y。我试过了getLocationOnScreengetLocationInWindow但结果未定义。

nativescript nativescript-angular

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

NativeScript/TypeScript:找不到命名空间“android”

我的打字稿文件中有以下代码

  const startActivity: android.app.Activity = app.android.startActivity;
  const context: android.content.Context = app.android.context;
  let intent: android.content.Intent;
Run Code Online (Sandbox Code Playgroud)

为什么它显示错误'找不到命名空间'android'。我是否需要安装与原生 android 相关的插件(例如 tns-platform-declarations)

谢谢。

非常感激你的帮助。

typescript nativescript

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

在 $navigateBack 中传递更改的道具

我有一个概览页面,人们可以在其中查看结果。他们可以选择通过单击编辑按钮来更改该值。通过单击编辑按钮,您将导航到另一个页面,您可以在其中更改值。如果您更改了值,您将返回概览页面。但我的问题是我传递的道具this.$navigateBack()在概览页面中没有改变。

概览页面

<template>
<Page class="confirmPage" actionBarHidden="true">
    <StackLayout>
        <Button class="back fas btn btn-db" :text="'\uf060 Route Details' | unescape" @tap="$navigateBack"></Button>
        <GridLayout columns="2*, 2*, 1*" rows="*, *, *" class="routeDetails">
            <Label row="0" col="0" class="centerIt" text="Ziekenhuis"></Label>
            <Label row="0" col="1" :text="$props.hospital"></Label>
            <Label row="0" col="2" class="fas btn btn-t-d btn-cr-sm" :text="'\uf303' | unescape" @tap="onEditHospital"></Label>

            <Label row="1" col="0" class="centerIt" text="Startpunt"></Label>
            <Label row="1" col="1" :text="$props.startpoint"></Label>
            <Label row="1" col="2" class="fas btn btn-t-d btn-cr-sm" :text="'\uf303' | unescape" @tap="onEditStartpoint"></Label>

            <Label row="2" col="0" class="centerIt" text="Bestemming"></Label>
            <Label row="2" col="1" :text="$props.endpoint"></Label>
            <Label row="2" col="2" …
Run Code Online (Sandbox Code Playgroud)

vue.js nativescript nativescript-vue

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

打字稿错误:“全局”类型上不存在属性“localStorage”

打字稿书呆子我有这个代码:

import * as appSettings from 'application-settings';

try {
    //  shim the 'localStorage' API with application settings module 
    global.localStorage = {
        getItem(key: string) {
            return appSettings.getString(key);
        },
        setItem(key: string, value: string) {
            return appSettings.setString(key, value); 
        }
    }

    application.start({ moduleName: 'main-page' });
}
catch (err) {
    console.log(err);
}
Run Code Online (Sandbox Code Playgroud)

...VScode 给了我[ts] Property 'localStorage' does not exist on type 'Global'. [2339]关于如何解决这个错误的想法?

这是一个 Nativescript 应用程序。参考这里是整个文件/应用程序:https : //github.com/burkeholland/nativescript-todo/blob/master/app/app.ts

typescript nativescript

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

未找到 NativeScript tns doctor 命令

像这样安装 NativeScript 后:https ://docs.nativescript.org/start/ns-setup-os-x

当我运行该tns doctor命令时,才发现该命令未找到。

我该如何解决这个问题?

npm nativescript npm-install

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

Nativescript-vue 简单的选择组件,如 web

我想在nativescript-vue. 有没有可用的插件可以让我设计这样的布局并且它可以工作same as web <select>元素?我只是看着ListPicker组件,但它的布局不同。或者我怎样才能用ListPicker组件实现这样的布局?

在此处输入图片说明

任何帮助或建议将不胜感激。

nativescript nativescript-vue

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