Open ChristopherDoherty opened 10 years ago
Here's how I do a border around the filter button. First turn off all the borders, then set one on the selected one.
-(void) filterClicked:(UIButton *) sender {
for(UIView *view in self.filterScrollView.subviews){
if([view isKindOfClass:[UIButton class]]){
[(UIButton *)view setSelected:NO];
((UIButton *)view).layer.borderColor = [[UIColor clearColor] CGColor];
}
}
[sender setSelected:YES];
sender.layer.borderColor = [[UIColor whiteColor] CGColor];
[self removeAllTargets];
selectedFilter = sender.tag;
[self setFilter:sender.tag];
[self prepareFilter];
}
to add a label with the name you'd need to edit the loadFilters method and instead of just using the UIButton created there, create your own UIView, add the UIButton and a label, set your label text, then add it
[self.filterScrollView addSubview:yourNewUIView];
Thanks so much, application nearly finished now!
Hello, I have been using this fantastic library for a little over two month, and by this point I have fully implemented what I will need for my app. However, I was wondering if anyone knew how to add some more customisation to the UIButton's in the Scroll View, so that I can show names of the custom filters, and also how to add a border for the selected filter. I have attempted to do this for a few hours to no avail. Could anyone help with this?
Regards, Christopher