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

incorrect container size in iPhone landscape mode #76

Open
haifengkao opened this issue Apr 23, 2014 · 9 comments
Open

incorrect container size in iPhone landscape mode #76

haifengkao opened this issue Apr 23, 2014 · 9 comments

Comments

@haifengkao
Copy link

I want to resize my controls to avoid the ad banner occluding them.
However, the containerView's height (50) is much larger than the height of admob's banner (32). It leaves an unpleasant blank between the controls and the banner.

ios simulator screen

@larsacus
Copy link
Owner

Since different ad networks will have ad banners with varying sizes, the ad container was built to accommodate the largest common denominator of the networks I support. I simply haven't designed in support for shrinking the container to fit the content it is displaying at the current point in time.

@haifengkao
Copy link
Author

I guess I have to do it myself :(
Is it a viable solution to shrink the container based on the size of its largest subview?

@larsacus
Copy link
Owner

Yes, I would be happy to accept a pull request for functionality that has not been thought of or built yet.—
Sent from Mailbox

On Fri, Apr 25, 2014 at 1:45 PM, Hai Feng Kao [email protected]
wrote:

I guess I have to do it myself :(

Is it a viable solution to shrink the container based on the size of its largest subview?

Reply to this email directly or view it on GitHub:
#76 (comment)

@haifengkao
Copy link
Author

This issue cannot be solved by the current design of LARSAdController. Reason: the ad view is a subview of parentView. If I shrink parentView to avoid the overlapping with the ad view, the ad view has to be put outside the bound of parentView. It makes the ad view non-clickable.

@larsacus
Copy link
Owner

larsacus commented May 1, 2014

You would not resize parentView, but adjust your sibling subviews to compensate for the ad's presence.—
Sent from Mailbox

On Thu, May 1, 2014 at 11:27 AM, Hai Feng Kao [email protected]
wrote:

This issue cannot be solved by the current design of LARSAdController. Reason: the ad view is a subview of parentView. If I shrink parentView to avoid the overlapping with the ad view, the ad view has to be put outside the bound of parentView. It makes the ad view non-clickable.

Reply to this email directly or view it on GitHub:
#76 (comment)

@haifengkao
Copy link
Author

Thanks for the tip. I got a little problem though. It is difficult to figure out the correct layout for these subviews in different orientations. If I shrink the subviews in portrait orientation, the layout might be messed up when the device rotates to landscape.

@larsacus
Copy link
Owner

larsacus commented May 5, 2014

You can use autoresizing masks or auto layout to compensate your layout for the varying height of the ad container.

@haifengkao
Copy link
Author

If I adjust the height of parentView, the auto layout will be applied to its subviews automatically. If I adjust the height of the subviews, the layout will be messed up.

@haifengkao
Copy link
Author

I believe we need a better API to support the "shrinking the container to fit the content" feature.

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