感谢您发布您的问题。我们 LeadBolt 的技术团队提供了以下建议来帮助您。
如果您需要进一步的帮助,我建议您直接联系您的客户经理,或给我们的支持团队发送电子邮件。
To Add a simple auto-refreshing HTML Banner:
1. In your xaml file, add a WebView object like so: <WebView x:Name="banner" Width="320" Height="50" />
2. Add the following code in your xaml.cs file. Please note this is just a sample code, please modify the class and method names as suited to your App’s xaml.cs file:
namespace HTMLAdDemo
{
public sealed partial class MainPage : Page
{
private DispatcherTimer timer = new DispatcherTimer();
String bannerHtml = “<html><body style=\”margin:0;padding:0\”><script type=\"text/javascript\" src=\"http://ad.leadboltads.net/show_app_ad.js?section_id=YOUR_LB_SECTION_ID\"></script></body></html>”;
public MainPage()
{
this.InitializeComponent();
banner.NavigateToString(bannerHtml);
// now setup timer to refresh banner every 30s
timer.Tick += (sender, e) => { bannerWebview.NavigateToString(bannerHtml); };
timer.Interval = new TimeSpan(00, 0, 30); //change this number to modify the refresh time
timer.Start();
}
// Your other App Specific functions here
}
}
添加带有关闭按钮的应用程序墙。请注意:这只是一个示例代码,您的应用程序中的实际实现可能会有所不同以适应您的应用程序的要求(即颜色、文本和样式需要根据您的应用程序的要求进行修改):
1. In your xaml file, add the following objects:
<WebView x:Name="appWall" Width="400" Height="300" />
<Button x:Name="closeButton" Width="400" Height="40" Content="Close" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Click="Button_Click"/>
2. Add the following code in your xaml.cs file. Please note this is just a sample code, please modify the class and method names as suited to your App’s xaml.cs file
namespace HTMLAdDemo
{
public sealed partial class MainPage : Page
{
public MainPage()
{
this.InitializeComponent();
appWall.Navigate(new Uri("http://ad.leadboltads.net/show_app_wall?section_id=YOUR_LB_SECTION_ID"));
}
private void Button_Click(object sender, RoutedEventArgs e)
{
appWall.Visibility = Visibility.Collapsed;
closeButton.Visibility = Visibility.Collapsed;
}
// Your other App Specific functions here
}
}
亲切的问候,
引线螺栓支持