我正在使用 Xamarin Forms,今天我在我的應用程式中意識到 iOS 上的奇怪事情。頂部 Shell 專案(通常是后退按鈕和頁面標題)現在有一些奇怪的陰影,我不知道如何禁用它。有人可以幫我嗎?

這兩項:
<Shell.BackButtonBehavior>
<BackButtonBehavior Command="{Binding BackButtonCommand}" IconOverride="ic_arrow_green_left" />
</Shell.BackButtonBehavior>
<Shell.TitleView>
<Grid Style="{StaticResource NavBarGridWrapper}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="50" />
</Grid.ColumnDefinitions>
<Label Style="{StaticResource NavBarMainTitle}" Text="{Binding Source={x:Static appResources:Resource.SettingsTitle}, Converter={StaticResource StringToUpper}}" />
</Grid>
</Shell.TitleView>
應用程式.xaml:
<!-- NavBar -->
<Style
x:Key="NavBarGridWrapper"
TargetType="Grid">
<!--<Setter Property="HorizontalOptions" Value="Fill" />
<Setter Property="VerticalOptions" Value="Fill" />-->
</Style>
<Style
x:Key="NavBarMainTitle"
TargetType="Label">
<Setter Property="FontFamily" Value="{StaticResource MontserratBold}" />
<Setter Property="FontSize" Value="{DynamicResource MediumFontSize}" />
<Setter Property="TextColor" Value="{StaticResource DarkGrayText}" />
<Setter Property="VerticalOptions" Value="Center" />
</Style>
uj5u.com熱心網友回復:
您可以在您的appshell.xaml:
<Style x:Key="BaseStyle" TargetType="Element">
.....
<Setter Property="Shell.NavBarHasShadow" Value="False" />
</Style>
uj5u.com熱心網友回復:
在我的情況下,在后面的頁面代碼中設定了 NavBarHasShadow:
public partial class HomeView : ContentPage
{
public HomeView()
{
InitializeComponent();
Shell.SetNavBarHasShadow(this, false);
}
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/329453.html
標籤:C# ios 沙马林 xamarin.forms xamarin.ios
上一篇:XamarinAndroid模擬器在滾動視圖中使用網格,僅繪制網格的第一頁
下一篇:知道是什么原因導致Android上Xamarin.Forms中的非托管代碼出現java.util.concurrentModificationException嗎?
