2017-02-13 80 views
0

正在使用nativescript版本2.5.0。我的应用程序已成功在网络上工作。但在nativescript中它不会显示任何内容。nativescript Listview不显示

tns.html

<GridLayout rows="*"> 

<ListView [items]="views$ | async" (itemTap)="onClickView($event.view.bindingContext)"> 
    <template let-view="item"> 
    <Label [text]="view"></Label> 
    </template> 
</ListView> 

</GridLayout> 

component.ts

@Component({ 
moduleId: module.id, 
selector: 'sd-list', 
templateUrl: 'list.component.html', 
styleUrls: ['list.component.css'] 
}) 
export class ListComponent implements OnInit { 
public views$: Observable<any>; 


constructor(private store: Store<IAppState>, private route: ActivatedRoute) { 
console.log("Inside listcomonent"); -----> This console is working 
this.views$ = store.let(getViews); 

this.listType$ = store.let(getListType); 
} 
} 

这就是我。在我的Web应用程序中,列表视图中填充了值。但在原生脚本(android)的情况下,什么都不显示。我该怎么办?任何帮助将非常可观和有益的。

+0

你能够在Chrome上调试应用程序吗?你可能会发现一定有一些东西在Android上不起作用。 – MobileEvangelist

回答

0

也许这个问题与您设置标签文本属性的方式有关。你可以尝试下面的代码​​。 如需进一步的帮助,您还可以查看示例here,其中显示了ListView和异步管道的简单示例。