【发布时间】:2012-01-12 11:16:52
【问题描述】:
我在 Adwhirl 中展示广告时遇到了一些问题。
我正在那里展示 Millenial Media 和 Admob 广告。
Admob 看起来不错,但是当加载 MM 广告时,它看起来广告太长了。
我试图以某种方式修复它,但无法修复它。
这是我的 Adwhirl 的 Java 代码:
LinearLayout layout = (LinearLayout) findViewById(R.id.layout_main);
AdWhirlLayout adWhirlLayout = new AdWhirlLayout(this, "apid");
RelativeLayout.LayoutParams adWhirlLayoutParams =
new RelativeLayout.LayoutParams(
LayoutParams.FILL_PARENT,
LayoutParams.WRAP_CONTENT);
int diWidth = 320;
int diHeight = 53;
float density = getResources().getDisplayMetrics().density;
adWhirlLayout.setMaxWidth((int)(diWidth * density + 0.5f));
adWhirlLayout.setMaxHeight((int)(diHeight * density + 0.5f));
layout.addView(adWhirlLayout, adWhirlLayoutParams);
layout.invalidate();
如果有人知道如何解决它,请帮忙。
编辑:
我正在开发 HTC Desire,还尝试在 xml 中创建 adwhirl 布局,但仍然是同样的问题;(
我尝试将 MM 布局添加到 xml 并使用参数 app:width="320" 它看起来不错。默认为 480,使用此值,广告看起来类似于 adwhirl 实施(太长)
xmlns:app="http://millennialmedia.com/android/schema"
<com.millennialmedia.android.MMAdView
android:id="@+id/mmadview"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
app:apid="28911"
app:adType="MMBannerAdTop"
app:refreshInterval="30"
app:accelerate="true"
app:ignoreDensityScaling="false"
app:age="46"
app:gender="female"
app:zip="90210"
app:income="85000"
app:keywords="moms,shopping,groceries"
app:ethnicity="hispanic"
app:orientation="straight"
app:marital="married"
app:children="2"
app:education="college"
app:politics="libertarian"
app:height="60"
app:width="480" /> <------------------------------------HERE
也许可以在 adwhirl 布局中设置此值?
编辑 2:
480x800 设备的分辨率似乎存在问题。我在 QVGA 320x240 模拟器上调试了应用程序,广告看起来很不错。
编辑 3:
它看起来像链接中的图片:Too long MM ad in Adwhirl Layout
当广告出现时,我可以看到水平滚动条,我认为我只能看到这些广告的 2/3
【问题讨论】:
-
我没有使用 AdWhirl,但我也遇到了同样的问题,广告太大了...您找到解决方案或联系 Millennial Media 了吗?