1
我想創建一個按鈕,使用圖像作爲背景並在背景上放置我的文本。如何在WinRT中的按鈕中的圖像上放置文本
我想是這樣的:
<Button Style="{StaticResource ImageButtonStyle}">
<StackPanel>
<TextBlock Text="test"></TextBlock>
<Image Source="ms-appx:///Skins/Images/buton.png" Stretch="None" />
</StackPanel>
</Button>
文本將無法正確居中。
<Button Style="{StaticResource ImageButtonStyle}">
<StackPanel>
<TextBlock Text="test"></TextBlock>
<Label Padding="0">My Button Text</Label>
</StackPanel>
</Button>
控件Label
不存在。
如何在我第一次嘗試中正確地在圖像上居中顯示文字? 你知道更好的方法嗎?
謝謝,它的工作 –