Nativescript RadDataForm MultilineText 不适用于 Android [英] Nativescript RadDataForm MultilineText not working on Android

查看:19
本文介绍了Nativescript RadDataForm MultilineText 不适用于 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Nativescript Angular 项目中使用 RadDataForm,当我尝试使用MultilineText"时,它在 Android 上不起作用,它只是显示为一个普通的文本"框.我无法输入多行.在 iOS 上运行良好.

I am using RadDataForm in my Nativescript Angular project and when I try to use "MultilineText" it doesn't work on Android, it just appears as a normal "Text" box. I am not able to enter multiple lines. Works fine on iOS.

add-store.model.ts

export class AddStore {
    public name: string;
    public description: string;

    constructor(name: string, description: string,) {
        this.name = name;
        this.description = description;
    }
}

add-store-metadata-validation.json

{
    "isReadOnly": false,
    "commitMode": "immediate",
    "validationMode": "immediate",
    "propertyAnnotations":
    [
        {
            "name": "name",
            "displayName": "Store Name",
            "index": 1,
            "editor": "Text"

        },
        {
            "name": "description",
            "displayName": "Description",
            "index": 2,
            "editor": "MultilineText"

        }

    ]
}

add-store.component.ts

import { Component, AfterViewInit } from "@angular/core";
import { RouterExtensions } from "nativescript-angular/router";
import { UtilitiesService } from "~/services/utils.service";
import { AddStore } from "./add-store.model";

@Component({
    selector: "add-store",
    moduleId: module.id,
    templateUrl: "./add-store.component.html"
})

export class AddStoreComponent implements AfterViewInit {

    store: AddStore;
    metadata;

    constructor(private router:RouterExtensions) {
        this.store = new AddStore("test name" , "test\nsdfgfsdf");
        this.metadata = require("./add-store-metadata-validation.json");
    }

    ngAfterViewInit(): void { 

    }

    goBack() {
        this.router.back();
    }
}

add-store.component.html

<ActionBar class="action-bar" title="Store Setup">
    <NavigationButton android.systemIcon="ic_menu_back" (tap)="goBack()"></NavigationButton>
</ActionBar>
<GridLayout rows="*">
        <StackLayout row="0" class="page page-content" height="100%">
            <RadDataForm [source]="store" [metadata]="metadata"></RadDataForm>
        </StackLayout>  
</GridLayout>

推荐答案

看起来是插件的问题,你可以在 反馈仓库.

It looks like a issue with plugin, you may report same in the feedback repo.

作为一种解决方法,您可以使用 TKPropertyEditor 指令并定义编辑器类型.

As a workaround you may use TKPropertyEditor directive and define the editor type.

这篇关于Nativescript RadDataForm MultilineText 不适用于 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆