Xaml 窗口电话-瓷砖与图片在中间和文本在底部
我正在开发一个windows phone应用程序,想做一些类似的东西 我尝试使用方形按钮,然后添加图片:Xaml 窗口电话-瓷砖与图片在中间和文本在底部,xaml,windows-phone,Xaml,Windows Phone,我正在开发一个windows phone应用程序,想做一些类似的东西 我尝试使用方形按钮,然后添加图片: <Button Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10"> <Button.Background> <ImageBrush Stretch="Fill"
<Button Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="10">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Assets/Marker.png"/>
</Button.Background>
</Button>
但是我没有找到在按钮底部添加文本的方法。
<Button Grid.Row="1"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
VerticalContentAlignment="Bottom" HorizontalContentAlignment="Left"
Margin="10">
<Button.Background>
<ImageBrush Stretch="Fill" ImageSource="Assets/Marker.png"/>
</Button.Background>
Button Text
</Button>
按钮文本
@Wolfgang不必担心,祝你周末愉快!哦,我想补充一点,当你开始想做一些真正的定制/酷的东西时,你会想开始挖掘控件的样式模板,以获得你真正想要的…但我认为这个答案现在就足够了。当然,让我们考虑一下。您当前正在将图像作为ImageBrush加载到Background
dependency属性权限?因此,当您将笔刷颜色设置为背景时,它将覆盖另一个声明的背景,因为它只有一个属性。不过,您有多种选择,您可以直接在按钮中弹出图像,或者我个人,我会使用另一个对象自定义按钮模板来承载图像,并可能使用标记
属性传入文件路径。然后你可以设置你的颜色,你的形象,一切