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

bug in new custom padding code #58

Closed
ubragg opened this issue Oct 8, 2014 · 4 comments
Closed

bug in new custom padding code #58

ubragg opened this issue Oct 8, 2014 · 4 comments
Labels

Comments

@ubragg
Copy link

ubragg commented Oct 8, 2014

Now that the code uses self.contentPadding in SDCAlertViewContentView, I found an issue.

When the content view is initialized, the appearance hasn't yet been applied, so when initializing the title and message labels, the following doesn't work:

self.titleLabel.preferredMaxLayoutWidth = SDCAlertViewWidth - self.contentPadding.left - self.contentPadding.right;

self.messageLabel.preferredMaxLayoutWidth = SDCAlertViewWidth - self.contentPadding.left - self.contentPadding.right;

This is because self.contentPadding isn't yet initialized here, so the layout widths don't get set right, and I'm finding that the end result is that sometimes my labels don't get sized properly.

@sberrevoets sberrevoets added the bug label Oct 8, 2014
@sberrevoets
Copy link
Owner

contentPadding is a UIAppearance-conforming property, so the default should always be set using UIAppearance.

I'll investigate, but I may not be able to get back to you until the weekend. In the meantime, you could opt for using version 1.4.1. A PR would be fantastic as well.

Thanks for your bug report!

@dtogias
Copy link

dtogias commented Oct 13, 2014

I noticed the same thing.

@sberrevoets
Copy link
Owner

Hopefully, I'll be able to take a look tonight. Shouldn't be too hard to solve. Thanks for your patience!

@sberrevoets
Copy link
Owner

This should be fixed now. Apparently UIAppearance only kicks in after adding a view to the view hierarchy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants