Segment underline issue
Hi,
I have downloaded and using your YAScrollSegmentControl. In my case I need to add YAScrollSegmentControl to a popup view programmatically. I have added it and set up array with buttons. The problem is selection for the first segment for the first time appearance is not being applied. Initially first index should be in selected mode. It is not happening for me. While debugging I found one thing. that is in the below method you have written a condition where you are checking class type like this..
-
(void)setSelectedIndex:(NSInteger)selectedIndex { if ([self.scrollView viewWithTag:selectedIndex] && [[self.scrollView viewWithTag:selectedIndex] isKindOfClass:[UIButton class]]) { //this code is not executed for me when I don't set selectedIndex in - (void)setButtons:(NSArray *)buttons method explicitly.
//But it executes when I set selectedIndex=1 in - (void)setButtons:(NSArray *)buttons method
} }
If I set selectedIndex = 1 underline is being applied, but first segment is not visible. I need to scroll to see invisible first item. I I set selectedIndex = 0 - (void)buttonSelect:(UIButton *)sender method is not called. Because of that didSelectItemAtIndex:sender.tag is not called. I am working on swift and creating everything programmatically. Please help me in this. Let me know if you need more information from me. Thank you.