标签: nativescript-telerik-ui

NativeScript-Vue在Android下渲染RadListView非常慢并冻结UI

我有一个带有RadListView组件的nativescript-vue应用程序,用于向用户显示数据。列表的每一行都包含当前项目的多个信息。当我点击一个按钮以加载并显示列表时,UI冻结(快速硬件->短;慢速硬件->长)。我发现加载/合并数据的代码部分运行时间很短,但是UI元素的nativescript内部渲染或创建是问题所在。android控制台显示信息

I/Choreographer: Skipped 430 frames!  The application may be doing too much work on its main thread.
Run Code Online (Sandbox Code Playgroud)

平台信息:

  • tns-ios 5.2.0
  • tns-android 5.2.1
  • nativescript-ui-listview 6.2.0
  • tns-core-modules 5.3.1

类似问题报告

我看了stackoverflow和github,但是那里的问题(例如NativeScript Angular RadListView渲染速度非常慢)看起来相似,但是解决方案不适合我。

我使用LinearListView(而不是Grid或Stagged),也许在我的真实应用程序中,我将能够简化列表中的行元素,但在我的示例应用程序中(向下看),我将使用简单的行ui设计。

示例应用

为了获得更简单,更好的报告,我在{N} -Playground上创建了一个示例应用程序。该应用程序将创建10000个数组元素并将其设置为RadListView的源,其中每个元素都有一个Label,一个Switch和一个ActivityIndi​​cator。

I/Choreographer: Skipped 430 frames!  The application may be doing too much work on its main thread.
Run Code Online (Sandbox Code Playgroud)

第一步,将在一个临时数组中生成10000个元素:

loadData() {
    this.tmpAlarms = [];
    for (let i = 0; i <= 10000; i++) {
        this.tmpAlarms.push({
            name: "Hase " + i,
            active: i % 2 === 0, …
Run Code Online (Sandbox Code Playgroud)

radlistview nativescript nativescript-telerik-ui nativescript-vue

9
推荐指数
1
解决办法
460
查看次数

类'Subject <T>'错误地扩展了基类'Observable <T> Nativescript导航抽屉错误

#这是我现在面临的错误:

我使用npm(https://github.com/shripalsoni04/nativescript-angular-drawer-template)下载了导航抽屉样本.但它会出现以下错误.

dhrn@dhrn-Inspiron-5548:~/NativeApp/Supervisor$ tns run android

Searching for devices...
iTunes is not available for this operating system. You will not be able to work with connected iOS devices.
Executing before-prepare hook from /home/dhrn/NativeApp/Supervisor/hooks/before-prepare/nativescript-dev-typescript.js
Found peer TypeScript 2.4.1
node_modules/rxjs/Subject.d.ts(16,22): error TS2415: Class 'Subject<T>' incorrectly extends base class 'Observable<T>'.
  Types of property 'lift' are incompatible.
    Type '<R>(operator: Operator<T, R>) => Observable<T>' is not assignable to type '<R>(operator: Operator<T, R>) => Observable<R>'.
      Type 'Observable<T>' is not assignable to type 'Observable<R>'.
        Type …
Run Code Online (Sandbox Code Playgroud)

typescript nativescript angular2-nativescript nativescript-telerik-ui

7
推荐指数
1
解决办法
1万
查看次数

NativeScript Angular ListPicker 的行为类似于“&lt;select&gt;”

默认情况下,ListPicker会占用大量屏幕空间。有没有办法让它<select>在移动设备上显示时像 HTML 的隐喻一样?

我之前使用过这个 React Native 插件,它正是我想要的隐喻,但是对于 NativeScript。

通过 NativeScript 可以轻松做到这一点吗?我想利用特定于平台的选择隐喻,因此显示/隐藏ListPicker或放入ListPicker模式不是我想要的。

另外,我将有一个相当长的列表,因此操作对话框对我不起作用。

更新:我知道nativescript-drop-down,但是它不使用 webviews 和React Native 插件所做的平台特定的“从选择列表中选择”小部件。

我所说的“从选择列表中选择特定于平台的小部件”是指(来自https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select):

iOS(音符选择器在键盘所在的位置呈现,使用 rolodex 选择器):

Android(注意模式,带有滚动选项列表):

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

7
推荐指数
1
解决办法
5805
查看次数

使Nativescript Telerik UI RadListView在Angular中工作

TNS v2.5.0

我已经导入LISTVIEW_DIRECTIVES了我的app.module,我的模板看起来像

<ActionBar title="Events"></ActionBar>
<StackLayout orientation="vertical">
    <RadListView [items]="events">
        <template tkListItemTemplate let-event="item">
            <StackLayout orientation="vertical">
            <Image [src]="'https:' + event.image" stretch="aspectFit"></Image>
            <Label [nsRouterLink]="['/event', event.id]" [text]="event.title"></Label>
            </StackLayout>
        </template>
    </RadListView>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)

但这只显示为常规ListView可以正常显示。

另外,如果我尝试一个GridLayout喜欢

<ActionBar title="Events"></ActionBar>
<GridLayout>
    <RadListView [items]="events">
        <template tkListItemTemplate let-event="item">
            <StackLayout orientation="vertical">
            <Image [src]="'https:' + event.image" stretch="aspectFit"></Image>
            <Label [nsRouterLink]="['/event', event.id]" [text]="event.title"></Label>
            </StackLayout>
        </template>
    </RadListView>
</GridLayout>
Run Code Online (Sandbox Code Playgroud)

该应用程序崩溃并显示错误消息

file:///app/tns_modules/nativescript-telerik-ui/listview/listview.js:1034:104:JS错误TypeError:未定义不是一个对象(正在评估'itemViewDimensions.measuredWidth')2月5日11:40:53 Marcuss -iMac com.apple.CoreSimulator.SimDevice.1A8C1E25-DAC0-4BA0-822E-5A6F731F1CD7.launchd_sim [31919](UIKitApplication:org.nativescript.t4g [0x7b2a] [36194]):由于分段错误而退出了服务:11

不知道我是否错过了某个地方的导入,但是文档非常粗略,因此很难确定并查看示例

listview nativescript angular2-nativescript nativescript-telerik-ui

5
推荐指数
2
解决办法
3056
查看次数

图像按钮Nativescript和Angular

我需要创建一个图像按钮,其中包含自定义图像和{N} + Angular中的标签.像这样的东西:

在此输入图像描述

这是我的代码.我正在使用网格布局中的堆栈布局.我看不到图像下方的标签.

<GridLayout columns="*,*" rows="*,*,*,*,*,*"  width="400" height="400">
    <StackLayout class="  btn-sq-lg  " col="0" row="0" (tap)="gotoSRTPage()">
        <Image  col="0" row ="1" src="res://ic_briefcase" > </Image>
        <Label class= "label" textWrap="true" col="0" row="2" text="SRT" horizontalAlignment="center" verticalAlignment="center"></Label>
    </StackLayout>  
    <StackLayout class="  btn-sq-lg  " col="1" row="0" (tap)="">
        <Image  col="1" row ="1" src="res://ic_blog" > </Image>
        <Label  class= "label" col="1" row="2" text="SRT" horizontalAlignment="center" verticalAlignment="center"</Label>
        </StackLayout>    
         <StackLayout class="  btn-sq-lg  " col="0" row="3" (tap)="">
        <Image  col="0" row ="4" src="res://ic_reminder" > </Image>
        <Label class= "label" textWrap="true" col="0" row="5" text="SRT" horizontalAlignment="center" verticalAlignment="center"></Label>
        </StackLayout> …
Run Code Online (Sandbox Code Playgroud)

nativescript angular2-nativescript nativescript-telerik-ui

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

nativescript |layouts 为 ngFor 循环创建 ui

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

谢谢你

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

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

iOS中使用nativescript-google-maps-sdk的地图中心错误

在iOS中,当我放置marker和mapView位置时,地图不会居中显示,但是如果我将手机移至横向并再次旋转至纵向,则地图中心将显示正常。在Adnroid工作正常。

您可以在以下github问题中获得更多信息:https : //github.com/dapriett/nativescript-google-maps-sdk/issues/322

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

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

NativeScript:GridLayout对齐问题

我是新来的NativeScript。我正在遵循自己的文件。我正在尝试UI对齐。我无法实现这一目标。我正在使用Xcode IDE并在中运行iOS Simulator

杂货徽标应位于顶部

文字栏位应在中间

注册按钮应该在底部

尝试1

<Page loaded="loaded">

<GridLayout height=auto horizontalAlignment="center" verticalAlignment="center" columns="*" rows="auto,auto,*"  backgroundColor="brown">
    <Image src="res://logo" stretch="aspectFit" horizontalAlignment="center" verticalAlignment="top" col="0" row="0"></Image>
    <GridLayout columns="*" rows="auto,auto,auto" verticalAlignment="center" backgroundColor="lightgray" col="0" row="1">

        <TextField class="userTxtFld" id="email" text="{{ email }}" hint="Email Address" keyboardType="email" autocorrect="false" autocapitalizationType="none"  col="0" row="0"/>
        <TextField secure="true" text="{{ password }}" hint="Password" col="0" row="1"/>
        <Button text="Sign in" tap="signIn"  col="0" row="2"/>

    </GridLayout>
    <Button text="Sign up for Groceries" class="link" tap="register" verticalAlignment="bottom" col="0" row="2"/>
</GridLayout>
</Page>
Run Code Online (Sandbox Code Playgroud)

尝试2

<Page loaded="loaded">

<GridLayout …
Run Code Online (Sandbox Code Playgroud)

xml grid-layout nativescript nativescript-telerik-ui

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

Assets 文件夹不包含 NativeScript Android Build 中的 HTML 文件

我正在尝试显示一个本地 html 文件,其中包含引用的 JS 和 CSS 以及 PNG 图像。我将这些文件放入适用于 Android 的 NativeScript x Angular 应用程序的资产文件夹中。当我运行 tns run android --bundle 并构建应用程序时 - 资产文件夹不包含 html。文件夹结构从 assets > index.html (和 index.html 引用其他文件)。

是否有某个地方或方式我需要包含 html 文件,以便它们包含在构建中?

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

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