c# - Adding ToolbarItems to MainPage.xaml.cs in a Xamarin.Forms Project
问题描述
As described in the title I am looking to add a ToolbarItem to my MainPage.xaml.cs in a Xamarin.Forms Project.
This is because I want an Actionbar on my Android App.
This to my knowledge is available on a NavigationPage.
I have not been able to set my Mainpage as a NavigationPage despite many attempts, it appears it will not let me set it as anything other than a ContentPage.
So far the best information I can find on this subject is here:
xamarin.forms not showing ToolbarItem
This however does not answer my question as it is relevant to App.xaml.cs not MainPage.xaml.cs
And my project is a multi-platform Xamarin.Forms for building apps apps for IOS and Android with Xamarin and Xamarin.Forms project.
Currently however I'm just focusing on Android in the shared C# project (MainPage.xaml.cs).
Thanks in Advance.
解决方案
推荐阅读
- python-3.x - 如何按不同列合并数据框行
- javascript - 如何停止复制下拉列表的日期?我使用了一个while循环
- powershell - PowerShell While循环多个条件不起作用
- karate - 试图断言 2 个动态响应
- python - 如何使用包含我要访问的索引号的数组获取 numpy 数组中的所有值
- javascript - 在添加为选项卡的“内容页面”中获取 Microsoft Team 上下文
- mysql - 查询不工作。也许“分组依据”有问题。怎么了?
- yocto - rootfs 中的 Yocto helloword 配方
- regex - 正则表达式替换特定字符后的字符串?
- java - 如何使用 HSSF apache poi (JAVA) 上的相关参考克隆函数