sách gpt4 ăn đã đi

c# - 将子高度或宽度设置为与android中的 "match_parent"相同的父控件

In lại 作者:太空狗 更新时间:2023-10-29 19:59:57 24 4
mua khóa gpt4 giày nike

我有一个包含网格的页面,在该网格内有一张 map 。但是我无法将 map 的大小设置为与网格大小相同。虽然我可以在代码中将其设置为

MyMap.Height = LayoutRoot.ActualHeight;
MyMap.Width = LayoutRoot.ActualWidth;

但是我如何在 xaml 中设置它。

<>
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:maps="clr-namespace:Microsoft.Phone.Maps.Controls;assembly=Microsoft.Phone.Maps"
x:Class="MapSample.MainPage"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
shell:SystemTray.IsVisible="True">






câu trả lời hay nhất

您应该将 map 控件的 HorizontalAlignmentVerticalAlignment 设置为 Stretch


HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Center="47.6097, -122.3331"
ZoomLevel="10" />

关于c# - 将子高度或宽度设置为与android中的 "match_parent"相同的父控件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14868984/

24 4 0
Chứng chỉ ICP Bắc Kinh số 000000
Hợp tác quảng cáo: 1813099741@qq.com 6ren.com
Xem sitemap của VNExpress