我在Nativescript Angular项目中使用RadDataForm,当我尝试使用“ MultilineText”时,它在Android上不起作用,它只是显示为普通的“文本”框。我无法输入多行。在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>