煎茶触摸 - 当AD浏览报加到不会调整 [英] Sencha Touch - won't resize when AdView is added

查看:184
本文介绍了煎茶触摸 - 当AD浏览报加到不会调整的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的:

private void setupAds() {
    AdView adView = new AdView(this, AdSize.BANNER, "a15138083566f58");
    LinearLayout layout = super.root;
    layout.addView(adView);

    AdRequest request = new AdRequest();
    request.setTesting(true);
    adView.loadAd(request);

    super.root.requestLayout();
}

在广告加载,它涵盖了我的应用程序的底部。如果我转了方向,一切正常重新呈现。这必定意味着web视图是正确的大小,但煎茶触摸是不尊重的尺寸变化,对吧?

When the ad loads, it covers up the bottom of my application. If I switch the orientation, everything re-renders correctly. This must mean that the WebView is the right size, but Sencha Touch isn't respecting the size change, right?

我该如何解决这个问题?

How do I fix this?

推荐答案

当编程方式添加到AD浏览通常把它添加到您已专门创建大小为目的的ViewGroup。我不知道什么煎茶触摸的,但如果super.root是的ViewGroup整个活动,然后你的显示器会在什么根查看什么类型的布局指定的完全依赖。

When adding an AdView programmatically to would normally add it into a ViewGroup that you have specially created and sized for that purpose. I have no idea what Sencha Touch is but if super.root is the ViewGroup for the whole Activity then your display will depend entirely upon what type of Layout what specified for the root View.

建议你创建你的布局AdViewParent并添加AD浏览报成说。

Suggest you create a AdViewParent in your layout and add the AdView into that.

这篇关于煎茶触摸 - 当AD浏览报加到不会调整的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆