繁体   English   中英

WinUI3 ComboBox 和 Button 有不同的大小

[英]WinUI3 ComboBox and Button have different size

我们有一个ComboBox和一个Button彼此相邻。 它们在两个不同的Grid.Columns中的同一个Grid.Row中。

然而,它们似乎都有不同的大小。 即使通过设置VerticalAlignment="Stretch"这也没有改变。

最后但同样重要的是,我为两个元素设置了固定高度,但它们的大小仍然不同。

那是怎么来的,我该如何改变它?

这是问题的图片

这适用于我的示例应用程序。

<Grid RowDefinitions="Auto,Auto">
    <TextBlock Text="Test" Grid.Row="0" />
    <Grid
        Grid.Row="1"
        ColumnDefinitions="Auto,Auto"
        RowDefinitions="Auto,Auto">
        <ComboBox
            Grid.Row="1"
            Grid.Column="0"
            VerticalAlignment="Stretch"
            CornerRadius="0"
            SelectedIndex="0">
            <TextBlock Text="Auswahlen" />
        </ComboBox>
        <Button
            Grid.Row="1"
            Grid.Column="1"
            VerticalAlignment="Stretch"
            CornerRadius="0">
            <FontIcon
                FontFamily="Segoe MDL2 Assets"
                Glyph="&#xE819;" />
        </Button>
    </Grid>
</Grid>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM