【问题标题】:Adding admob or mobclix to wiengine android app将 admob 或 mobclix 添加到 wiengine android 应用程序
【发布时间】:2011-11-11 15:26:53
【问题描述】:

我正在尝试将一些 mobclix 广告实现到基于 wiengine 的 Android 应用程序中,该应用程序基本上是 cocos2d 的 Java 端口。有没有人试过这样做?如果是这样,请告诉我如何;)

要明确的基本问题是,由于 wiengine 使用基于非标准视图的类 (WYGLSurfaceView),因此您无法轻松地在现有视图之上添加另一个广告视图。

谢谢,

尼克

【问题讨论】:

    标签: android integration ads cocos2d-android


    【解决方案1】:

    使用 Activity.addContentView,示例:

    FrameLayout.LayoutParams lp = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.FILL_PARENT,
        FrameLayout.LayoutParams.WRAP_CONTENT);
    lp.gravity = Gravity.BOTTOM;
        lp.bottomMargin = 10;
    AdView ad = new AdView(this);
    ad.setResId("xxx");
    ad.setGoneIfFail(true);
    addContentView(ad, lp);
    ad.requestAd();
    

    完整答案:http://blog.wiyun.com/?cat=8

    【讨论】:

      【解决方案2】:

      好吧,我不确定它是否会回答您的问题,但我们可以推出一项新活动:

      Intent toInfoIntent = new Intent(Director.getInstance().getContext(), InfoActivity.class);
      Director.getInstance().getContext().startActivity(toInfoIntent);
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2015-07-31
        • 2020-05-23
        • 1970-01-01
        • 1970-01-01
        • 2014-06-30
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多