【问题标题】:How to place ads in a fixed position in WP8.1 c#如何在WP8.1 c#中将广告放置在固定位置
【发布时间】:2017-08-01 20:09:21
【问题描述】:

我正在努力让我的应用看起来更专业,但我在尝试让我的广告位置像 1st4fans manchester united edition 一样贴在应用栏顶部时遇到了一点问题,我已经尝试过在我的应用中添加调解器,但如果屏幕尺寸发生变化,它会改变位置。

这是我添加的代码

  <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>

【问题讨论】:

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


    【解决方案1】:

    使用边距摆脱“绝对”布局,将其与底部对齐。

    【讨论】:

    • 所以请将我的答案设置为已接受,以便帮助更多人
    猜你喜欢
    • 2013-02-06
    • 1970-01-01
    • 2020-03-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多