Android 4.1 RelativeLayout 和底部定位广告(多媒体)

标签 android xamarin.android

我在将 Millenial Media(http://mmedia.com/) 广告定位在屏幕底部时遇到问题。有时它有效,但有时广告无缘无故地跳到屏幕中央。其他时候,广告只是从那个位置开始。有时,广告只是在中间位置和底部位置之间快速跳转。

我已经尝试了一些相对位置、选项和配置,但没有任何东西可以正常工作。

该广告具有 AlignParentBottom 属性,我不确定这是否只是 MMedia sdk 的问题或其他问题。

这只是在最新版本的 SDK 中才开始发生。有没有人使用 MMedia 并且可以阐明将广告定位到屏幕底部?

我在 Android 4.1 上使用 Google Nexus。

这是 XML:

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent">
    <GameView
            android:id="@android:id/list"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"/>
    <com.millennialmedia.android.MMAdView
            android:id="@+id/ad"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true"/>
</RelativeLayout>

最佳答案

我对第 3 方组件也有“非常有趣”的行为。 我已经解决了将他嵌入容器(我记得是 LinearLayout)的问题,所以我的建议是将 com.millennialmedia.android.MMAdView 添加到 LinearLayout 并添加到 RelativeLayout。我无法解释为什么对我有用,也无法解释为什么没有包装器就不能像我想要的那样工作,但这就是解决方案。

希望对你有帮助。

关于Android 4.1 RelativeLayout 和底部定位广告(多媒体),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13215106/

相关文章:

java - 在模糊代码中隐藏字符串

c# - Xamarin.Android 中的文件提供程序异常

android - 在进度对话框上添加取消按钮

xamarin.android - Protobuf-Net 在 Release模式下因 InvalidOperationException 在 Monodroid 上失败

android - MediaPlayer 不播放某些音频文件的实时流

Android MediaPlayer 暂停,音量键不控制多媒体

java - 如何通过搜索另一个子值来更新某个值?

iphone - 元视口(viewport)是否覆盖固定元素宽度

xaml - 用于自定义按钮的 ImageButton GestureRecognizers

android - Mac 上的 debug.keystore 在哪里?