【发布时间】:2019-12-30 13:20:48
【问题描述】:
我无法在 nativescript-angular 应用程序的屏幕中间将 RadViewList 的元素居中。 在 Playground 中查看:https://play.nativescript.org/?template=play-ng&id=ZFOHYN&v=4
我尝试了几种方法都没有结果:FlexBoxLayout、horizontalAlignment 和 verticalAligmnent、内联 css、css 显示 flex..
在 Playground 中查看:https://play.nativescript.org/?template=play-ng&id=ZFOHYN&v=4
<StackLayout class="page">
<GridLayout tkExampleTitle tkToggleNavButton>
<RadListView col="1" [items]="name"
selectionBehavior="LongPress"
multipleSelection="true" reorderMode="Drag"
backgroundColor="gray"
height="100%" itemReorder="true" padding="10">
<ng-template tkListItemTemplate let-item="item">
<GridLayout>
<Label [text]="item" textAlignment="center"
witdh="95%"
height="95%" margin="5px" padding="15px"
backgroundColor="red" fontSize="30"></Label>
</GridLayout>
</ng-template>
<ListViewGridLayout tkListViewLayout
scrollDirection="Vertical"
ios:itemHeight="250" spanCount="5">
</ListViewGridLayout>
</RadListView>
</GridLayout>
</StackLayout>
元素停留在左上角!!
【问题讨论】:
-
...另外,
Label中存在拼写错误——它显示的是witdh="95%"而不是width。 -
@Tim 谢谢你,但这并不能解决问题
标签: angular nativescript radlistview