GLSurfaceView 与其他视图重叠
我有一个以编程方式创建的布局,当我的应用程序收到广告时,它将显示一个 admob 视图,将我现有的 GLView 向下推并调整其大小。
然而,虽然它最初似乎将我的 GLView 向下推,但 GLView 突然重置自身并与 AdMob 视图重叠,并将自身重置为原始大小。
这就是我调整 GLSurfaceView 大小和位置的方法:
Main.Instance.admobView.setVisibility(View.VISIBLE);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(Main.Instance.GLView.getWidth(),
Main.Instance.GLView.getHeight() - AdSize.BANNER.getHeight());
params.topMargin = AdSize.BANNER.getHeight();
Main.Instance.GLView.setLayoutParams(params);
Main.Instance.TopView.requestLayout();
这就是我最终得到的:
https:// i.sstatic.net/UuwKA.png
有谁知道可能导致此问题的原因吗?
I've got a programmatically-created layout, where when my app gets ads, it'll show an admob view, pushing my existing GLView down and resizing it.
However, although it initially seems to be pushing my GLView down, the GLView suddenly resets itself and overlaps the AdMob view and resets itself to its original size.
This is what I do to resize and reposition the GLSurfaceView:
Main.Instance.admobView.setVisibility(View.VISIBLE);
RelativeLayout.LayoutParams params = new RelativeLayout.LayoutParams(Main.Instance.GLView.getWidth(),
Main.Instance.GLView.getHeight() - AdSize.BANNER.getHeight());
params.topMargin = AdSize.BANNER.getHeight();
Main.Instance.GLView.setLayoutParams(params);
Main.Instance.TopView.requestLayout();
This is what I get in the end:
https://i.sstatic.net/UuwKA.png
Does anyone have any idea what could be causing this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论