给定以下 xaml 结构
<Grid>
<StackPanel>
<TextBlock>
<TextBlock>Block 1</TextBlock>
<TextBlock>Block 2</TextBlock>
</TextBlock>
<TextBlock>
<TextBlock Visibility="Collapsed">Block 3</TextBlock>
<TextBlock>Block 4</TextBlock>
</TextBlock>
<TextBlock>
<TextBlock>Block 5</TextBlock>
<TextBlock>Block 6</TextBlock>
</TextBlock>
</StackPanel>
</Grid>
我期望这个输出:
Block 1 Block 2
Block 4
Block 5 Block 6
但我明白了
Block 1 Block 2
Block 4
Block 5 Block 6
来自之前的空间在哪里Block 4
,我如何让它消失?