Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/337.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在Zebble for Xamarin中创建页面底部的固定按钮?_C#_Xamarin_Xamarin.android_Xamarin Zebble_Zebble - Fatal编程技术网

C# 如何在Zebble for Xamarin中创建页面底部的固定按钮?

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

我需要在页面底部创建两个带有列表视图的按钮。因此,我在页面主体中创建了两个堆栈,并将listview和按钮放入其中,如下所示:

<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>