1
問題是當我的設備的主題設置爲黑暗時,在顯示和隱藏ApplicationBar
動畫時出現黑色背景。我要麼是白色的,要麼沒有背景。ApplicaionBar在隱藏或顯示時顯示黑色背景
我的XAML文件
<phone:PhoneApplicationPage
x:Class="AppBarTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.ApplicationBar>
<shell:ApplicationBar Mode="Default" Opacity="1.0" IsMenuEnabled="False" IsVisible="True" BackgroundColor="#AAAAAA" ForegroundColor="Black">
<shell:ApplicationBarIconButton IconUri="/Assets/add.png" Text="add"/>
<shell:ApplicationBarIconButton IconUri="/Assets/delete.png" Text="delete"/>
<shell:ApplicationBarIconButton IconUri="/Assets/feature.camera.png" Text="camera"/>
</shell:ApplicationBar>
</phone:PhoneApplicationPage.ApplicationBar>
<Grid Background="White">
<Button Content="Hide/Show" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Black" Background="Green" Click="Button_Click" Margin="112,66,122,0" Height="150" Width="246"/>
</Grid>
</phone:PhoneApplicationPage>
我的CS文件
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
private void Button_Click(object sender, RoutedEventArgs e)
{
ApplicationBar.IsVisible = !ApplicationBar.IsVisible;
}
}
勞爾它工作。好的解釋只是設置了「不透明度=」0.99「'。如果可以的話,我願意給你100張選票:) –
@InderKumarRathore你總是可以找到我的一些其他答案,並使他們滿意;)http://stackoverflow.com/users/1755/matt-lacey?tab=answers –
他他他...:DI已經做到了:D –