我在拉伸图像以填充按钮方面遇到问题,我是UWP的新手,这是我的代码:
<Grid Margin="0,0,0,54" VerticalAlignment="Bottom" Height="39" Style="{Binding HorizontalAlignment, ElementName=grid}" ScrollViewer.HorizontalScrollBarVisibility="Auto">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Button Grid.Column="0" Height="39" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Image Source="images/icon1.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="True" d:LayoutRounding="Auto" />
</Button>
<Button Grid.Column="1" Height="39" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" >
<Image Source="images/icon2.png" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="True" d:LayoutRounding="Auto" />
</Button>
</Grid>
答案 0 :(得分:16)
您可能需要更改按钮的Padding和BorderThickness属性。如下面的代码:
BufferedOutputStream