问题一:下面的“Div”和“object”的“宽和高”都要设置为“100%”对吧???
对的
问题二:“UserControl ”的宽和高应该怎样设置??? 怎样设置为“100%”???
通过以下代码你可以发现内部的Grid填充了整个页面,通过HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
<Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Red">
<Canvas HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Black">
</Canvas>
</Grid>
“d:DesignHeight 、d:DesignWidth” 和 “Width 、
Height”有什么不同??
d:DesignHeight 、d:DesignWidth可以忽略,这个是设计时的视图,并不是运行时的视图
问题三:这个“Grid”的宽和高都设为“100%”??? 怎样设置???
见问题二
问题四:要使“Canvas”的高度固定,其值为“ 65”。而其宽度则为“100%”,使宽度根据分辨率变化而变化。
<Grid x:Name="LayoutRoot" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Red">
<Canvas Height="65" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="Black">
</Canvas>
</Grid>
问题五:此“Grid”和上面的“Canvas”平级,它们两个一上一下。此“Grid”的宽度设置“100%”,而高度则应填充满“Canvas”剩余的区域(Canvas高度固定为了“65”),应该怎样布局才可以??? 应该怎样做???
你这个就需要运行时确定了,ActualHeight-65=需要设置的Grid高度.
或者直接提供一个Grid,Canvas放在第一行,Grid放在第二行(建议)