CategorySliderView
CategorySliderView copied to clipboard
Setting backgroundColor
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
Hi,
I added setBackgroundColor: method to project,
and removed the yellowColor in init method