Android Ad-mob无法在所有屏幕中正常显示?

时间:2013-11-19 12:40:37

标签: android relativelayout

大家好,在我的一个应用程序中使用AD-mob,但它在我的设备中无法正常工作? 这里附有截屏....!

Level 8 Android 2.3 my ad-mob display like this

enter image description here

S2 device Ad-mob display like this it addjust all the screen 

并且在nexus 4中,Ad-mob仅在屏幕上显示为什么会出现这个问题的任何一个想法有助于这个

我正在使用此代码

XML

 <RelativeLayout
    android:id="@+id/adBannerRelativeLayout"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:visibility="gone"
    android:layout_alignParentBottom="true" >
</RelativeLayout> 

这是Java代码

    MMAdView adView = new MMAdView(activity);
        adView.setApid(" "); // id
        // Set your metadata in the MMRequest object
        MMRequest request = new MMRequest();
        // Add the MMRequest object to your MMAdView.
        adView.setMMRequest(request);
        // Sets the id to preserve your ad on configuration changes.
        adView.setId(MMSDK.getDefaultAdId());   
        //RelativeLayout layout = (RelativeLayout) activity.findViewById(R.id.cur_mainlayout);

        //view = inflater.inflate(R.layout.modified_news_layout, null);
        adRelativeLayout = (RelativeLayout) activity.findViewById(R.id.adBannerRelativeLayout);
        adRelativeLayout.addView(adView, new RelativeLayout.LayoutParams(LayoutParams.FILL_PARENT,
                    UtilityClass.dynamicScalingForWidth(46)));
        adRelativeLayout.setVisibility(View.VISIBLE);        
        adView.getAd();

0 个答案:

没有答案