And*_*hop 5 ads windows-8 winrt-xaml
一,截图:

标题和图像很好地解释了它.我的应用主视图组右侧有一个广告设置(非常类似于此示例中的默认网格模板),当我拉出"关于"屏幕时,广告会流下来.
"关于"屏幕是在SettingsFlyout上设置的用户控件,我从一个开发营地(下面)发布的一些代码示例中借用了这些控件.
class SettingsFlyout
{
private const int _width = 346;
private Popup _popup;
public void ShowFlyout(UserControl control)
{
_popup = new Popup();
_popup.Closed += OnPopupClosed;
Window.Current.Activated += OnWindowActivated;
_popup.IsLightDismissEnabled = true;
_popup.Width = _width;
_popup.Height = Window.Current.Bounds.Height;
control.Width = _width;
control.Height = Window.Current.Bounds.Height;
_popup.Child = control;
_popup.SetValue(Canvas.LeftProperty, Window.Current.Bounds.Width - _width);
_popup.SetValue(Canvas.TopProperty, 0);
_popup.IsOpen = true;
}
private void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
{
if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
{
_popup.IsOpen = false;
}
}
void OnPopupClosed(object sender, object e)
{
Window.Current.Activated -= OnWindowActivated;
}
}
Run Code Online (Sandbox Code Playgroud)
而且,因为我知道它会被要求,这是XAML在我的页面上定义广告的一行:
<ads:AdControl Visibility="{Binding IsTrial, Source={StaticResource License}, Converter={StaticResource BooleanToVisibilityConverter}}" Grid.Row="0" Grid.RowSpan="2" x:Name="LandscapeAdControl" ApplicationId="test_client" AdUnitId="Image_160x600" Width="160" Height="600" VerticalAlignment="Center" HorizontalAlignment="Right"/>
Run Code Online (Sandbox Code Playgroud)
那么,为什么会发生这种情况,我该如何预防呢?
猜疑
我仍然在使用Consumer Preview b/c我周一有一个show-and-tell,没有时间在这个盒子上迁移操作系统而不会在我显示这个时失去功能.因此,如果它是一个错误,升级可能会修复它.
表1.A 更新我已升级到Release Preview并遇到同样的问题.
扰流板警报:ZIndex未设置在任何位置.
| 归档时间: |
|
| 查看次数: |
1508 次 |
| 最近记录: |