首先,截圖:Windows 8的廣告顯示在設置補足彈出
標題和圖像解釋得很好。我在應用的主要羣組視圖的右側放置了廣告(與此示例中的默認網格模板非常相似),當我拉起我的「關於」屏幕時,廣告流血。
「關於」屏幕是在SettingsFlyout上設置的一個用戶控件,我通過在dev-camp(下面)發佈的一些代碼示例中借用。
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;
}
}
而且,因爲我知道它會被要求,這裏是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"/>
那麼,爲什麼會出現這種情況,而且我怎麼預防它?
猜疑
我仍然在消費者預覽版B/C我有一個展示和告訴星期一和沒有時間來對這個盒子遷移操作系統中使用,而不用擔心存在當我顯示這個時,這個功能不起作用。因此,升級可能會修復它,如果它是一個錯誤。
1.a. 更新我已升級到發佈預覽並具有相同的問題。
- 在這裏玩還有一些奇特的隱藏但仍然得到印象的預防技術嗎?也許它認爲我正在嘗試用ui元素來覆蓋廣告,並且在用戶看不到它的情況下仍然可以得到它的印象。如果是這樣,我該如何管理這個完全合法的用例?
尾翼警報:Z-索引未設置任何地方。
Consumer Preview的廣告sdk確實有空域問題。發佈預覽廣告SDK可以解決它,但我不會屏住呼吸。您可能必須通過隱藏廣告來找到解決方法,然後彈出窗口或彈出窗口處於活動狀態或類似的狀態。 – Denis