【发布时间】:2015-12-28 16:01:28
【问题描述】:
设计器将图像作为按钮加载,但模拟器加载时没有图像。我可以推测这可能是一个“超出屏幕的图像渲染”问题。任何有关代码的建议将不胜感激。
设计器完全可见,两个图像分割屏幕(假设是按钮),而模拟器显示一半屏幕为黑色,其余部分显示为灰色水平分割。
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height=".5*"/>
<RowDefinition Height=".5*"/>
</Grid.RowDefinitions>
<Button
x:Name="CricketButton" Grid.Row="0"
Height="auto" Width="auto"
HorizontalAlignment="Stretch"
Margin="-5" VerticalAlignment="Stretch"
Click="CricketButton_Click"
FontSize="25" RequestedTheme="Light" Opacity="0.9" BorderThickness="0">
<Image Source="Assets\cricket-hd-wallpapers.jpg" Stretch="Fill" Opacity="0.7"/>
<!--<TextBlock Text="Cricket" HorizontalAlignment="Right" VerticalAlignment="Bottom" Foreground="White"
FontSize="72"/>-->
</Button>
<Button
x:Name="Football" Grid.Row="1"
HorizontalAlignment="Stretch"
Height="auto" Width="auto"
Margin="-5"
VerticalAlignment="Stretch"
Click="Football_Click"
FontSize="25"
RequestedTheme="Light" Opacity="0.9" Background="#FFC7C7C7" BorderThickness="0">
<Image Source="Assets\real-madrid-granada.jpg" Opacity="0.9" Stretch="Fill"/>
</Button>
</Grid>
【问题讨论】:
标签: windows xaml emulation designer