如何在WP8.1中将广告置于固定位置c#

时间:2017-03-11 13:52:32

标签: c# windows xaml windows-phone-8 windows-phone-8.1

我正在尝试让我的应用程序看起来更专业但是我有一点问题我试图让我的广告位置坚持在应用程序栏顶部,就像在1st4fans曼彻斯特联合版enter image description here中一样,我有我试图在我的应用中添加admediator,但如果更改了屏幕尺寸,则会改变位置。

这是我添加的代码

  <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" Mode="Default"  >
            <shell:ApplicationBar.MenuItems>

            </shell:ApplicationBar.MenuItems>
            <shell:ApplicationBarIconButton x:Name="Refresh" IconUri="/Assets/AppBar/refresh.png" IsEnabled="True" Text="Refresh" Click="Refresh_Click"/>
            <shell:ApplicationBarIconButton x:Name="Deals" IconUri="Assets/AppBar/appbar.dollar.png" IsEnabled="True" Text="Deals" Click="Deals_Click"/>
            <shell:ApplicationBarIconButton x:Name="Share" IconUri="/Assets/AppBar/share.png" IsEnabled="True" Text="Share" Click="Share_Click"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="RLayoutRoot">
    <phone:WebBrowser x:Name="WebView" LoadCompleted="WebView_LoadCompleted" />
    <WindowsPhone8:AdMediatorControl x:Name="AdMediator_E63AA5" HorizontalAlignment="Left" Height="80" Id="AdMediator-Id-88DF6148-5162-486A-B897-11473F4AB2F9" Margin="-10,616,0,0" VerticalAlignment="Top" Width="480"/>
    <ProgressBar x:Name="ReadProgress"  HorizontalAlignment="Left" Height="60" VerticalAlignment="Top" Width="480" Margin="10,325,-10,0"/>
</Grid>

1 个答案:

答案 0 :(得分:1)

摆脱你的绝对&#34;布局使用边距并将其对齐到底部。