0

我在scrollviewer中放了一个MapControl,但是当我拉起MapControl时,MapControl覆盖了TitlePanel!喜欢这张照片 在此处输入图像描述 如何解决这个问题?是系统错误吗?Thx~~~

这是我的 xaml 代码

 <Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel 包含應用程式的名稱和頁面標題-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock x:Name="ApplicationTitle" Text="我的應用程式" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="頁面名稱" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - 其他內容置於此-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <ScrollViewer>
            <Grid Width="440" Height="258" VerticalAlignment="Top">
                <msMap:Map x:Name="Map" CopyrightVisibility="Collapsed" LogoVisibility="Collapsed" ScaleVisibility="Collapsed"  CredentialsProvider="Al1klJ_w8MPrZ0kntZyMogTJkXb79xyNKVC2XpJuwSPp0NmAbrIuAthSzs5xbomJ">                        
                </msMap:Map>
            </Grid>
        </ScrollViewer>
    </Grid>
</Grid>
4

1 回答 1

4

你的网格边距肯定有一些问题。如果你粘贴你的xaml代码。也许我会以更好的方式帮助你

[更新]

尝试:这对我有用。

   <Grid x:Name="LayoutRoot" Background="Transparent">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
        <RowDefinition Height="*"/>
    </Grid.RowDefinitions>

    <!--TitlePanel contains the name of the application and page title-->
    <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
        <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
        <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
    </StackPanel>

    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
        <ScrollViewer>
            <Grid MaxHeight="400" VerticalAlignment="Top">
                <my:Map HorizontalAlignment="Stretch" Name="map1" VerticalAlignment="Stretch" />
            </Grid>
        </ScrollViewer>
    </Grid>
</Grid>
于 2012-10-11T03:34:06.467 回答