【发布时间】:2017-12-03 22:53:17
【问题描述】:
我有这两张图片,其中一张在另一张之上:(推特图片和黑色图片):
黑色图像应该隐藏在底部 - 当用户点击推特页面时 - 黑色菜单应该从底部滑入。
黑色图像位于中间(在另一个图像的顶部),因为外部 Gridview 没有任何行 - 所以所有内容都作为 z-index 堆栈放置:
<GridLayout columns="*" >
<GridLayout slide-out>
<Image src="~/images/page.png" ></Image>
</GridLayout>
<StackLayout slide-in class="slide b" height="300" >
<Image src="~/images/replies.png" "></Image>
</StackLayout>
</GridLayout>
但是黑色图像(由 Stacklayout 保存)应该像这样隐藏在底部:
是否可以通过css将其隐藏在底部?
到目前为止我尝试了什么?
如您所见,Stacklayout 上有一个指令(名为 slide-in):
所以我在启动时设置了它的marginBottom:
constructor(el: ElementRef) {
this.element.nativeElement.marginBottom = 0;
}
但 Stacklayout 保持不变(在中间)/
如果我设置
this.element.nativeElement.marginBottom = -screen.mainScreen.heightDIPs;
它显示:
但它应该完全隐藏在底部
问题:
如何将其隐藏在底部?
【问题讨论】:
-
你试过css display:none; ?
-
@Sentry 我想从底部滑入。很抱歉没有提到这一点。我已经编辑了问题并添加了该信息。谢谢。
-
你也可以尝试做负边距,比如 margin-bottom:-100px;并尝试添加位置:绝对;到img。也许这会起作用
-
@Sentry 问题是我不知道
margin-bottom:XXX;的哪个值。我不想手动输入-我希望自动计算。我该怎么做? -
试试margin-bottom:-100vh;或 margin-top:100vh;
标签: android angular nativescript