通用应用中的AdControl显示图像太少

时间:2014-12-01 12:16:06

标签: c# xaml

我对AdControl有点问题。 AdControl显示广告,而我的PubCenter会计算所有内容,但图片太少(下):

enter image description here

    <ads:AdControl Grid.Row="2"
              AutoRefreshIntervalInSeconds="60"
              ApplicationId="myid"
              AdUnitId="myunitid"
              HorizontalAlignment="Center"
              Height="80"
              IsAutoRefreshEnabled="True"
              VerticalAlignment="Top"
              Width="400"/>

1 个答案:

答案 0 :(得分:1)

所以你说你的布局分为3行Grid;

<Grid>
   <Grid.RowDefinitions> 
      <RowDefinition Height="80"/> 
      <RowDefinition Height="*"/> 
      <RowDefinition Height="80"/> 
   </Grid.RowDefinitions>

</Grid>

...而且你希望你的广告消费那些&#34; 80&#34;第3排的高度,但仍保持其分辨率。所以你可以做这样的事情;

<ViewBox Grid.Row="2" Stretch="UniformToFill">
   <ads:AdControl Grid.Row="2"
                  AutoRefreshIntervalInSeconds="60"
                  ApplicationId="myid"
                  AdUnitId="myunitid"
                  IsAutoRefreshEnabled="True"/>
</ViewBox>

通过这种方式,它应该采用AdControl的任何内容,并使用它们来填充您提供的空间(在这种情况下,您在行高中设置的&#34; 80&#34;高度,使用Stretch="UniformToFill"设置时,它应该保留分辨率,同时填充该空间并保持与提供给它的任何宽高比相同的宽高比。

希望这会有所帮助,欢呼。