在使用我的 cocos2d-x 项目按照 HeyZap网站上的说明进行操作时,我注意到横幅被添加到 FrameLayout 中,如下所示:
FrameLayout bannerWrapper = (FrameLayout) findViewById(R.id.banner_wrapper);
我使用 Android Studio 在布局文件夹中创建了一个 activity_main.xml 文件,并创建了一个简单的 FrameLayout,如下所示:
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/banner_wrapper"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
</FrameLayout>
为了让我访问新创建的“banner_wrapper”FrameLayout,我必须调用 setContentView(R.layout.activity_main); 在我的 OnCreate() 方法中。这确实显示了横幅,但也可能导致 Cocos2dx 视图未显示。有没有办法将我的“banner_wrapper”覆盖在原始的 Cocos2dx 视图上?还是有更好的方法来做到这一点?