Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InMobiBannerCustomEvent.java - #1

Open
c3ph3us opened this issue Dec 19, 2016 · 0 comments
Open

InMobiBannerCustomEvent.java - #1

c3ph3us opened this issue Dec 19, 2016 · 0 comments
Assignees

Comments

@c3ph3us
Copy link

c3ph3us commented Dec 19, 2016

even height is set some inmobi api is disobeying size and making view to whole screen size

   imbanner.setLayoutParams(new ViewGroup.LayoutParams(Math.round(320 * dm.density), Math.round(50 * dm.density));
  • and i see when the view is laid out it layout params are -2 (wrap content) and child to fill parent

quick fix (workaround) is to make little change:

    imbanner.setLayoutParams(new ViewGroup.LayoutParams(Math.round(320 * dm.density), height));
    imbanner.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
        @Override
        public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) {
            ViewGroup.LayoutParams layoutParams = v.getLayoutParams();
            layoutParams.height = height;
            v.setLayoutParams(layoutParams);
        }
    });

btw you shouldn't make layout params as LinearLaoyut but generate from parent !!!

@vineetsri23 vineetsri23 self-assigned this Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants