我正在完成一个windows phone应用程序,主菜单是这样组织的:
<ScrollViewer HorizontalScrollBarVisibility="Auto" Grid.RowSpan="2">
<StackPanel Orientation="Horizontal">等等。我想把一个独特的图像背景作为我的3个网格的景观。
我听人说过
<Grid.Background>
<ImageBrush Stretch="None" ImageSource="Images/background_top.png" AlignmentY="Top" AlignmentX="Center"/>
</Grid.Background>但它似乎只适用于一个网格,而不是同时适用于几个网格。
如果有人知道如何表演这幅画。
提前谢谢。弗洛里安·塞尔瓦
编辑1:
<ScrollViewer HorizontalScrollBarVisibility="Auto" Grid.RowSpan="2">
<StackPanel Orientation="Horizontal">
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,150,35,0" Width="328">
<Grid.RowDefinitions>
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Image Name="Agni" Margin="15" Grid.Row="0" Grid.Column="0" Source="/img/SMITE/Hindu/Agni/Icone.png" Tap="tap"></Image>
<Image Name="AhMuzenCab" Margin="15" Grid.Row="0" Grid.Column="1" Source="/img/SMITE/Mayan/Ah Muzen Cab/Icone.png" Tap="tap"></Image>
<Image Name="Anhur" Margin="15" Grid.Row="0" Grid.Column="2" Source="/img/SMITE/Egyptian/Anhur/Icone.png" Tap="tap"></Image>
<Image Name="Anubis" Margin="15" Grid.Row="0" Grid.Column="3" Source="/img/SMITE/Egyptian/Anubis/Icone.png" Tap="tap"></Image>
<Image Name="AoKuang" Margin="15" Grid.Row="1" Grid.Column="0" Source="/img/SMITE/Chinese/Ao Kuang/Icone.png" Tap="tap"></Image>
<Image Name="Aphrodite" Margin="15" Grid.Row="1" Grid.Column="1" Source="/img/SMITE/Greek/Aphrodite/Icone.png" Tap="tap"></Image>
<Image Name="Apollo" Margin="15" Grid.Row="1" Grid.Column="2" Source="/img/SMITE/Greek/Apollo/Icone.png" Tap="tap"></Image>
<Image Name="Arachne" Margin="15" Grid.Row="1" Grid.Column="3" Source="/img/SMITE/Greek/Arachne/Icone.png" Tap="tap"></Image>
<Image Name="Ares" Margin="15" Grid.Row="2" Grid.Column="0" Source="/img/SMITE/Greek/Ares/Icone.png" Tap="tap"></Image>
<Image Name="Artemis" Margin="15" Grid.Row="2" Grid.Column="1" Source="/img/SMITE/Greek/Artemis/Icone.png" Tap="tap"></Image>
<Image Name="Athena" Margin="15" Grid.Row="2" Grid.Column="2" Source="/img/SMITE/Greek/Athena/Icone.png" Tap="tap"></Image>
<Image Name="Bacchus" Margin="15" Grid.Row="2" Grid.Column="3" Source="/img/SMITE/Roman/Bacchus/Icone.png" Tap="tap"></Image>
<Image Name="Bakasura" Margin="15" Grid.Row="3" Grid.Column="0" Source="/img/SMITE/Hindu/Bakasura/Icone.png" Tap="tap"></Image>
<Image Name="Cabrakan" Margin="15" Grid.Row="3" Grid.Column="1" Source="/img/SMITE/Mayan/Cabrakan/Icone.png" Tap="tap"></Image>
<Image Name="Bastet" Margin="15" Grid.Row="3" Grid.Column="2" Source="/img/SMITE/Egyptian/Bastet/Icone.png" Tap="tap"></Image>
<Image Name="Chaac" Margin="15" Grid.Row="3" Grid.Column="3" Source="/img/SMITE/Mayan/Chaac/Icone.png" Tap="tap"></Image>
<Image Name="ChangE" Margin="15" Grid.Row="4" Grid.Column="0" Source="/img/SMITE/Chinese/Chang'e/Icone.png" Tap="tap"></Image>
<Image Name="Chronos" Margin="15" Grid.Row="4" Grid.Column="1" Source="/img/SMITE/Greek/Chronos/Icone.png" Tap="tap"></Image>
<Image Name="Cupid" Margin="15" Grid.Row="4" Grid.Column="2" Source="/img/SMITE/Roman/Cupid/Icone.png" Tap="tap"></Image>
<Image Name="Fenrir" Margin="15" Grid.Row="4" Grid.Column="3" Source="/img/SMITE/Norse/Fenrir/Icone.png" Tap="tap"></Image>
<Image Name="Freya" Margin="15" Grid.Row="5" Grid.Column="0" Source="/img/SMITE/Norse/Freya/Icone.png" Tap="tap"></Image>
<Image Name="Geb" Margin="15" Grid.Row="5" Grid.Column="1" Source="/img/SMITE/Egyptian/Geb/Icone.png" Tap="tap"></Image>
<Image Name="GuanYu" Margin="15" Grid.Row="5" Grid.Column="2" Source="/img/SMITE/Chinese/Guan Yu/Icone.png" Tap="tap"></Image>
<Image Name="Hades" Margin="15" Grid.Row="5" Grid.Column="3" Source="/img/SMITE/Greek/Hades/Icone.png" Tap="tap"></Image>
</Grid>这是3个网格之一。
发布于 2014-08-21 19:40:33
如果希望图像覆盖整个页面,请在页面级别上设置背景:
<phone:PhoneApplicationPage.Background>
<ImageBrush Stretch="Fill" ImageSource="Images/background_top.png" />
</phone:PhoneApplicationPage.Background>https://stackoverflow.com/questions/25425306
复制相似问题