Xamarin.forms 如何在Xamarin表单中设置图标大小?]
我在Xamarin工具栏中添加了一个图标。但是我看到emulator中的图标看起来很小&仍然无法更改工具栏项目图标的大小。下面给出了我在XAML页面中的源代码Xamarin.forms 如何在Xamarin表单中设置图标大小?],xamarin.forms,icons,toolbar,Xamarin.forms,Icons,Toolbar,我在Xamarin工具栏中添加了一个图标。但是我看到emulator中的图标看起来很小&仍然无法更改工具栏项目图标的大小。下面给出了我在XAML页面中的源代码 <?xml version="1.0" encoding="utf-8" ?> <ContentPage[enter image description here][1] x:Class="IDIS.HomePage" xmlns="http://xamarin.com/schemas/2014/form
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage[enter image description here][1]
x:Class="IDIS.HomePage"
xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
BackgroundColor="White"
NavigationPage.HasNavigationBar="True">
<ContentPage.ToolbarItems>
<ToolbarItem
Icon="home1.png"
Order="Primary"
Priority="0"
Text="Home" />
<ToolbarItem
Icon="noti1.png"
Order="Primary"
Priority="1"
Text="Notification" />
<ToolbarItem
Icon="rating1.png"
Order="Primary"
Priority="2"
Text="Rating" />
<ToolbarItem
Icon="feedback1.png"
Order="Primary"
Priority="3"
Text="Feedback" />
<ToolbarItem
Order="Secondary"
Priority="0"
Text="Item 2" />
</ContentPage.ToolbarItems>
</ContentPage>
我的输出附加屏幕截图
实际上,您必须更改图像大小-以下是我使用的示例: 你可以从Xamarin的家伙那里得到一个很好的示例应用程序 Android 可绘制hdpi
- eShopOnContainers.Droid/Resources/drawable-hdpi/app_settings.png
- 256x256
- eShopOnContainers.Droid/Resources/drawable-xhdpi/app_settings.png
- 341 x 341
- eShopOnContainers.Droid/Resources/drawable-xxhdpi/app_settings.png
- 512 x 512
- eShopOnContainers.iOS/Resources/app_settings.png
- 44 x 44
- eShopOnContainers.iOS/Resources/app_settings@2x.png
- 44 x 44
- eShopOnContainers.iOS/Resources/app_settings@3x.png
- 66 x 66
- eShopOnContainers.Droid/Resources/drawable-hdpi/app_settings.png
- 256x256
- eShopOnContainers.Droid/Resources/drawable-xhdpi/app_settings.png
- 341 x 341
- eShopOnContainers.Droid/Resources/drawable-xxhdpi/app_settings.png
- 512 x 512
- eShopOnContainers.iOS/Resources/app_settings.png
- 44 x 44
- eShopOnContainers.iOS/Resources/app_settings@2x.png
- 44 x 44
- eShopOnContainers.iOS/Resources/app_settings@3x.png
- 66 x 66