-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
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 !!!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels