【问题标题】:Size of the image in the toolbar工具栏中图像的大小
【发布时间】:2021-09-30 07:55:47
【问题描述】:

想问有没有办法在工具栏中放大图片大小,因为aspect标签无法识别 在此输入代码 <ContentPage.ToolbarItems> <ToolbarItem IconImageSource="logo.JPG" x:Name="toolbar" /> </ContentPage.ToolbarItems>

【问题讨论】:

  • 嗨,Davide,你能告诉我们实际尺寸吗?或者你想放大多少?

标签: xamarin.forms xamarin.android toolbar


【解决方案1】:

我们无法控制工具栏项上的图像大小,但作为一种解决方法,可以使用NavigationPage.TitleView 来解决问题。

去掉ContentPage.ToolbarItems,设置ImageButtonTitleView,然后调整图片大小。

<NavigationPage.TitleView>
    <StackLayout>
        <ImageButton Source="dog.png" WidthRequest="50" HeightRequest="50" HorizontalOptions="End"/>
    </StackLayout>
</NavigationPage.TitleView>

请检查我的测试

之前(工具栏项)

之后(标题视图)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2018-01-23
    • 1970-01-01
    • 1970-01-01
    • 2015-03-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多