【发布时间】:2020-01-15 04:25:09
【问题描述】:
我希望这个星形(收藏)图标位于右下角
这是完整的标记 (Vue.js):
<Page actionBarHidden="true">
<GridLayout rows="*, auto">
<GridLayout row="0" class="page" rows="*">
<ListView row="0" for="(place, index) in places" @itemTap="onItemTap($event)">
<v-template>
<GridLayout columns="20, auto, *, *" rows="auto" class="place">
<StackLayout col="0" row="0" class="index" horizontalAlignment="center" verticalAlignment="center">
<label :text="index + 1" textAlignment="center" horizontalAlignment="center"></label>
</StackLayout>
<StackLayout col="1" row="0">
<Image src="~/images/layer20.png" stretch="fitAspect" class="thumb img-circle avatar"></Image>
</StackLayout>
<StackLayout col="2" row="0" orientation="vertical">
<label class="placeName" :text="place.name"></label>
<label class="type" :text="place.type"></label>
<label class="description" :text="place.description" textWrap="true"></label>
</StackLayout>
<GridLayout col="3" row="0" rows="auto, auto" class="lastColumn">
<Label row="0" class="distance" :text="place.distanceMeters+'m'" verticalAlignment="top"></Label>
<Label row="1" v-if="place.favorite" :text="'fa-star' | fonticon" class="fa favorite" verticalAlignment="bottom"></Label>
</GridLayout>
</GridLayout>
</v-template>
</ListView>
</GridLayout>
<BottomNavigation row="1" :navItems="this.bottomNavItems"></BottomNavigation>
</GridLayout>
</Page>
这是带有显示星号(收藏夹)标签的块的标记
<GridLayout col="3" row="0" rows="auto, auto" class="lastColumn">
<Label row="0" class="distance" :text="place.distanceMeters+'m'" verticalAlignment="top"></Label>
<Label row="1" v-if="place.favorite" :text="'fa-star' | fonticon" class="fa favorite" verticalAlignment="bottom"></Label>
</GridLayout>
我试过了:
- 指定显式列
- 将标签包装在 StackLayout 中
- 为 GridLayout 指定 100% 的显式高度
- 为标签指定显式高度
- 使用带有 GridLayout rows="auto, *, auto" 的中间空文本标签
- 重新编译所有内容,然后重新运行所有内容
标签似乎没有向下移动,没什么,nada。我正在运行 iOS 模拟器的 Mac 上工作。无法在 android 模拟器上测试,因为我有一些包命名空间问题,目前无法在 android 上编译。
2019 年 9 月 16 日更新
问题所在: https://play.nativescript.org/?template=play-vue&id=E4T5zO
【问题讨论】:
标签: vue.js nativescript