小编Oma*_*sam的帖子

Nativescript自定义组件

我按照本指南创建了一个nativescript自定义组件http://moduscreate.com/custom-components-in-nativescript/但它对我不起作用

我有一个文件夹页面,里面有一个名为main的文件夹. main有几个文件

main.html中

<StackLayout 
xmlns="http://schemas.nativescript.org/tns.xsd"
xmlns:hello="pages/helllo"
loaded="pageLoaded" >
  <hello:hello/>
</StackLayout>
Run Code Online (Sandbox Code Playgroud)

main.component.ts

import { Component, ElementRef, OnInit, ViewChild} from "@angular/core";
import { Page } from "ui/page";
import colorModule = require("color");
var Color = colorModule.Color;
@Component({
selector: "my-app",
templateUrl: "pages/main/main.html",
styleUrls: ["pages/main/main-common.css"]
})    
export class MainComponent implements OnInit{
      constructor(private page: Page) {
  }    

  ngOnInit() {
    this.page.actionBarHidden = true;
 }  
} 
Run Code Online (Sandbox Code Playgroud)

而且我也有main-common.css,但这并不重要.然后我在页面中有另一个名为hello的文件夹,里面只有一个文件

hello.html的

<StackLayout width="100%" height="100%" backgroundColorr="red">
  <Label class …
Run Code Online (Sandbox Code Playgroud)

android typescript nativescript angular

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

NativeScript浮动提示

我正在使用nativescript创建一个表单,我希望我的字段有像TextInputLayout一样的浮动提示,我发现这个插件nativescript-textinputlayout技术上完全符合我的要求,但问题是我使用我的应用程序使用了角度2,并且我似乎无法弄清楚如何使用角度为2的插件.有人可以帮忙吗?除了使用插件实现浮动提示之外,我还对其他解决方案持开放态度

android nativescript android-textinputlayout angular2-nativescript

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