0

我想在页面的 TopAppBar 中添加一个 adunit。

    <Page.TopAppBar>
        <AppBar IsOpen="True">
        <UI:AdControl 
          AutoRefreshIntervalInSeconds="60" 
          ApplicationId="be1500d6-9ca7-4a0b-a479-0db279d71e14" 
          AdUnitId="11191335" 
          HorizontalAlignment="Center" 
          IsAutoRefreshEnabled="True" 
          VerticalAlignment="Top" 
          Width="320"
          Height="50" IsAutoCollapseEnabled="True"
          />
        </AppBar>
    </Page.TopAppBar>

这编译并运行没有错误,但将其添加到我的代码后,Frame.Navigate 到此页面返回一个错误值。如何更正它以使导航成功?如果这不是正确的方法,那么我怎样才能让我的广告始终保持在页面顶部,即使在滚动时也是如此。

4

1 回答 1

0

Windows Phone 不支持顶部 AppBar。如果您想在页面顶部显示您的添加,请将其放在页面顶部的一行网格中。将要滚​​动的页面内容放在其下方的第二行中。就像是:

<Grid>
    <Grid.RowDefinitions>
         <RowDefinition Height="50"/>
         <RowDefinition Height="*" />
    </Grid.RowDefinitions>

    <UI:AdControl Grid.Row="0" />
    <GridView Grid.Row="1" /> <!-- or whatever else you want for the page content -->
</Grid>
于 2015-02-02T16:53:40.087 回答