【发布时间】:2019-12-11 02:12:54
【问题描述】:
我正在研究 xamarin。表单应用程序,我需要在其中添加图像侧 导航栏中的后退按钮。
我试过了
1. <NavigationPage.TitleView><image/></NavigationPage.TitleView> - 这里的视图远离后退按钮。后退按钮和图像之间的空间更大。
2. 创建如下自定义导航。
<Grid BackgroundColor="{Binding ActionbarColor}">
<StackLayout Orientation="Horizontal" Spacing="0" HeightRequest="60" HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand">
<Image Source="back.png" HeightRequest="20" WidthRequest="20" HorizontalOptions="Start" VerticalOptions="CenterAndExpand">
<Image.GestureRecognizers>
<TapGestureRecognizer Command="{Binding MoveBackCommand}"></TapGestureRecognizer>
</Image.GestureRecognizers>
</Image>
<Imge Source="defaultUser.png">
<Label />
<Label x:Name="TitleLabel" VerticalTextAlignment="Center" VerticalOptions="CenterAndExpand" TextColor="White" FontAttributes="Bold" FontSize="Medium" HorizontalOptions="FillAndExpand"/>
</StackLayout>
</Grid>
使用 2nd,导航到后视图时视图会闪烁。
除了这两种之外,还有什么方法可以在导航栏的后退按钮旁边显示图像
【问题讨论】:
标签: image xamarin.forms navigationbar