我正在嘗試將廣告整合到已成功部署的應用程序中。然而,無論我做什麼,我似乎都無法讓廣告運作。我已經嘗試使用代碼版本和拖放n'放gui版本。我都無法工作。Windows手機廣告無法正常工作
這就是我看到的:當它啓動時,它可能會閃爍一秒白色,廣告應該在哪裏,但是沒有更多,沒有增加。它承認它是我放置它的地方,當我把它放在一個按鈕上時,按鈕變得不可點擊。所有人都說,沒有默認的「微軟廣告」圖像彈出。我已經安裝了廣告SDK,並已成功地將廣告輕鬆展示在其他項目中。
什麼給?這是非常簡單的頁面,我無法弄清楚什麼是錯誤的。我似乎也不能在任何其他頁面上放置廣告......我確實有Microsoft.Advertising.Mobile和Microsoft.Advertising。 Mobile.UI包含在項目中,我的互聯網是工作(我有一個項目,同時與廣告開放和它的作品)
<phone:PhoneApplicationPage
x:Class="AppName.AdPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI">
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Margin="12,17,12,28">
<TextBlock x:Name="PageTitle" Text="Thank You!" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}" Width="334" />
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0" Height="569" VerticalAlignment="Top">
<Button Content="Ok" Height="72" HorizontalAlignment="Center" Margin="0,428,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />
<my:AdControl AdUnitId="Image480_80" ApplicationId="test_client" Height="80" HorizontalAlignment="Left" Margin="-12,458,0,0" Name="adControl1" VerticalAlignment="Top" Width="480" />
</Grid>
</Grid>
</phone:PhoneApplicationPage>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using Microsoft.Advertising.Mobile.UI;
using Microsoft.Advertising.Mobile;
namespace Stickey_Note_v._1
{
public partial class AdPage : PhoneApplicationPage
{
public AdPage()
{
InitializeComponent();
}
private void button1_Click(object sender, RoutedEventArgs e)
{
NavigationService.Navigate(new Uri("/MainPage.xaml", UriKind.Relative));
}
}
}
您的先生,不僅僅是特別有用的:)原來我沒有包括<能力名稱=「ID_CAP_NETWORKING」/>大聲笑去圖 – 2012-03-17 02:18:57
哈,很好。 :)很高興成爲服務。 – 2012-03-17 02:22:44
如果你想要綁定數據。 https://gist.github.com/1927879 – 2012-03-17 06:30:00