0

你好如何在底部显示mopub广告?

我有这个代码

RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(
                RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
        params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM);
        mopView = new MoPubView(this);
            mopView.setAdUnitId(PUB_ID_320x50);
            mopView.setLayoutParams(params);
            mopView.loadAd();
            mainRelative.addView(mopView, params);

但它显示在屏幕中心,如何与底部对齐?ps我的主要布局是RelativeLayout

4

1 回答 1

0

//将布局高度更改为生病的父级

 RelativeLayout.LayoutParams.MATCH_PARENT, RelativeLayout.LayoutParams.MATCH_PARENT);
params.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM,RelativeLayout.TRUE);
于 2012-07-25T10:09:22.890 回答