2

我想在页面中有一个固定的页脚,但我尝试了

<StackLayout>

和一个

position: absolute;
bottom: 0;

并在容器父级中

position: relative

但什么也没发生。

我试过了

<AbsoluteLayout bottom="0">

什么也没发生。

有人知道怎么做吗?谢谢!

4

1 回答 1

4

绝对在其中<AbsoluteLayout>放置元素。使用 NativeScript,我们必须使用布局容器在其中放置元素。

实现您想要的最佳布局:

1) <DockLayout>,例如

<DockLayout>
  <Label dock="bottom" height="60" backgroundColor="yellow" text="footer"/>
  <Label text="rest of the content"/>
</DockLayout>

2)<GridLayout>,例如

<GridLayout columns="*, 60">
  <Label col="0" text="rest of the content"/>
  <Label col="1" text="footer"/>
</GridLayout>

请研究布局容器文档

于 2018-10-10T23:25:12.527 回答