패널을 사각형으로 채우고 패널의 크기를 조정하면 사각형의 크기도 조정해야합니다.사각형 패널 채우기
왜 다음 작동하지 않습니까?
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<StackPanel HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Rectangle Fill="Red" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Rectangle Fill="Green" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
<Rectangle Fill="Blue" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</StackPanel>
</Page>
나는 때문에 자녀를 추가/열을 제거하고 재 배열의 고통의 Grid
를 사용하지 않으려는 것입니다. (내가 처음에 노란색 Rectangle
를 추가하고자한다면, 난 그냥 선언하기 때문이다. 내가 손으로 다른 주문을 다시 할 필요가 없습니다 StackPanel
기대했다.)
주 전체 사용 가능한 크기 소요
Grid
를 사용하여 방향. Rectangle의 DesiredSize가 0이기 때문에 세 직사각형 모두가 무효로 축소됩니다. –