Xamarine ContentPage.ToolbarItems移到页面底部

时间:2019-03-11 09:01:23

标签: xamarin.forms

以下是我的代码,我要执行的操作是将工具栏移至网格后的页面底部

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div> Looking for a solutions in:<br>
<input type="checkbox" value="Heating">Heating<br>
<input type="checkbox" value="Ac">AC<br>
<input type="checkbox" value="Cold Chain">Cold Chain<br>
<input type="checkbox" value="Others">Others<br>
</div>
<input name="specify" type="text" id="specify" style="display: none">
<input name="solutions" type="text" id="solutions">


<div><br>Are you an exisiting customer?<br>
<input type="radio" value="Yes" name="radio">Yes<br>
<input type="radio" value="No" name="radio">No
</div>

<input name="existing" type="text" id="existing">
<br><br>
Summary:<br>
<textarea type='text' id="summary"></textarea>

2 个答案:

答案 0 :(得分:0)

不幸的是,ShadowFormat shadow = Range.InlineShape[1].Shadow; shadow.ForeColor.RGB = Color.FromArgb(230, 50, 15).ToArgb(); // not working !! shadow.Type = Microsoft.Office.Core.MsoShadowType.msoShadow9; shadow.Style = Microsoft.Office.Core.MsoShadowStyle.msoShadowStyleOuterShadow; shadow.Transparency = 0.0f; 默认情况下是在页面顶部设计的。

如果要将ToolbarItem移动到页面底部,可以通过自定义视图来完成。您可以创建ToolbarItem,并且其中包含诸如ToolbarItem之类的按钮。此外,StackLayout可以设置为StackLayout下方。然后在页面底部看起来像GridLayout

示例代码如下:

ToolbarItem

enter image description here

答案 1 :(得分:0)

如果您要在底部放置android,请在TabbedPage中添加以下行。对于iOS,这是默认设置。

xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
android:TabbedPage.ToolbarPlacement="Bottom"

最后,您的页面将是这样的:

<?xml version="1.0" encoding="utf-8" ?>
<TabbedPage
  x:Class="SampleApp.MainPage"
  xmlns="http://xamarin.com/schemas/2014/forms"
  xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
  xmlns:android="clr-namespace:Xamarin.Forms.PlatformConfiguration.AndroidSpecific;assembly=Xamarin.Forms.Core"
  xmlns:views="clr-namespace:SampleApp"
  android:TabbedPage.ToolbarPlacement="Bottom">
  <TabbedPage.Children>
    <NavigationPage
      Title="Browse"
      BackgroundColor="White"
      Icon="tab_feed.png">
      <x:Arguments>
        <views:ItemsPage />
      </x:Arguments>
    </NavigationPage>
    <NavigationPage
      Title="About"
      BackgroundColor="White"
      Icon="tab_about.png">
      <x:Arguments>
        <views:AboutPage />
      </x:Arguments>
    </NavigationPage>
  </TabbedPage.Children>
</TabbedPage>