开发者

GLSurfaceView overlaps other views

开发者 https://www.devze.com 2023-03-15 11:33 出处:网络
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.

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.开发者_如何学GoInstance.GLView.setLayoutParams(params);

Main.Instance.TopView.requestLayout();

This is what I get in the end:

http://i.stack.imgur.com/UuwKA.png

Does anyone have any idea what could be causing this?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号