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

BadgeAlignment is always JSBadgeViewAlignmentTopRight #18

Closed
RubenSandwich opened this issue Oct 16, 2013 · 4 comments
Closed

BadgeAlignment is always JSBadgeViewAlignmentTopRight #18

RubenSandwich opened this issue Oct 16, 2013 · 4 comments

Comments

@RubenSandwich
Copy link

The BadgeAlignment property is always JSBadgeViewAlignmentTopRight.

This is because + (void)applyCommonStyle sets
badgeViewAppearanceProxy.badgeAlignment = JSBadgeViewAlignmentTopRight;

so the calls to
JSBadgeView *badgeViewAppearanceProxy = JSBadgeView.appearance;

in + (void)applyIOS7Style and + (void)applyLegacyStyle always gets set to JSBadgeViewAlignmentTopRight.

This can be fixed by commenting out/removing:
badgeViewAppearanceProxy.badgeAlignment = JSBadgeViewAlignmentTopRight;

in + (void)applyCommonStyle

@JaviSoto
Copy link
Owner

This is intended behavior. The value set in the appearance object is the default.

Are you setting it yourself, either via appearance, or manually on a JSBadgeView object?

@RubenSandwich
Copy link
Author

I'm setting the alignment within the init method:
[[JSBadgeView alloc] initWithParentView:rectangle alignment:JSBadgeViewAlignmentBottomLeft];

Which is where this bug occurs.

It doesn't happen when you set the alignment after the init:
badgeView.badgeAlignment = JSBadgeViewAlignmentBottomLeft;

Sorry that I wasn't more clear on that.

JaviSoto added a commit that referenced this issue Oct 16, 2013
…e setter so that UIAppearance doesn't override the value with the default one. Fixes issue #18.
@JaviSoto
Copy link
Owner

Fixed :)

@RubenSandwich
Copy link
Author

No problem, glad I could help. :)

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