C# 如何在Zebble for Xamarin中创建页面底部的固定按钮?
我需要在页面底部创建两个带有列表视图的按钮。因此,我在页面主体中创建了两个堆栈,并将listview和按钮放入其中,如下所示:C# 如何在Zebble for Xamarin中创建页面底部的固定按钮?,c#,xamarin,xamarin.android,xamarin-zebble,zebble,C#,Xamarin,Xamarin.android,Xamarin Zebble,Zebble,我需要在页面底部创建两个带有列表视图的按钮。因此,我在页面主体中创建了两个堆栈,并将listview和按钮放入其中,如下所示: <z-place inside="Body"> <Stack Direction="Vertical"> <Stack Id="top"> </Stack> <Stack Id="bottomMenu" Direction="Horizontal"> <Button T
<z-place inside="Body">
<Stack Direction="Vertical">
<Stack Id="top">
</Stack>
<Stack Id="bottomMenu" Direction="Horizontal">
<Button Text="Btn1" CssClass="btmButton1"></Button>
<Button Text="Btn2" CssClass="btmButton2"></Button>
</Stack>
</Stack>
</z-place>
但是,当我设置“顶部高度”按钮时,按钮被隐藏。要在导航栏页面底部创建按钮栏,您可以在common.scs中为所有平台使用此css角色
.btmButton1 {
background: linear-gradient(to bottom, #039795, #196e6d);
color: #ffffff;
height: 52px;
margin: 0;
border-radius: 0;
}
.btmButton2 {
background: linear-gradient(to bottom, #5c0eb3, #3f1968);
color: #ffffff;
height: 52px;
margin: 0;
border-radius: 0;
}
#top {
height: calc("(Zebble.Device.Screen.Height - 116)");
background: #dadada
}
#bottomMenu {
width: calc("Zebble.Device.Screen.Width");
height:52px;
}
您的主页视图代码主体是:
<z-place inside="Body">
<Stack Direction="Vertical">
<Modules.ContactsList Id="top" />
<Stack Id="bottomMenu" Direction="Horizontal">
<Button Text="Btn1" CssClass="btmButton1"></Button>
<Button Text="Btn2" CssClass="btmButton2"></Button>
</Stack>
</Stack>
</z-place>
在上面的代码中有一个通知是列表视图,在列表视图中,您应该使用滚动视图,以便能够上下滚动列表。此页面使用的模板是什么?
<z-place inside="Body">
<Stack Direction="Vertical">
<Modules.ContactsList Id="top" />
<Stack Id="bottomMenu" Direction="Horizontal">
<Button Text="Btn1" CssClass="btmButton1"></Button>
<Button Text="Btn2" CssClass="btmButton2"></Button>
</Stack>
</Stack>
</z-place>