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

Setting backgroundColor #2

Open
sandalsoft opened this issue Jan 9, 2015 · 1 comment
Open

Setting backgroundColor #2

sandalsoft opened this issue Jan 9, 2015 · 1 comment

Comments

@sandalsoft
Copy link

Hi,

I'm unable to set the backgroundColor of an initialized CategorySliderView. This code doesn't work and the view still has a yellow background, is there a trick to setting the background color or am I missing something?

[self.sliderView setBackgroundColor:[UIColor redColor]];

I found where this is hardcoded to yellow in the .m file, would you take a pull request to add setting the bgColor to the initWithFrame.... initializer like:

- (instancetype)initWithFrame:(CGRect)frame andCategoryViews:(NSArray *)categoryViews sliderDirection:(SliderDirection)direction categorySelectionBlock:(categorySelected)block withBackgroudColor:(UIColor *)bgColor;

EDIT:
I discovered that if I remove line 53: https://github.com/cemolcay/CategorySliderView/blob/master/CategorySliderView/CategorySliderView.m#L53
I'm able to set the backgroundColor in my instantiated CategorySlider. I'm happy to create a pull request to remove the [self.scrollView setBackgroundColor:[UIColor yellowColor]]; line and/or create an initializer. Let me know if you have a preference

@cemolcay
Copy link
Owner

Hi,
I added setBackgroundColor: method to project,
and removed the yellowColor in init method

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