Let me explain this bug first:
I customize the Tabbar when using 4 buttons instead of the button to set the point and not in the point of the picture, and then switch between the different pages should be only one point in the state, but I will appear in many or even all points in the case, engaged for a half a day to know where the problem.
for (int i=0; i<4; i++) {
// Write the button 's direct parent control BOTTOMBG go to the tag again, or there will be a problem .
UIButton * button = (UIButton *) [bottombgviewwithtag:+i];
UIButton * Button = (UIButton *) [Self.view viewwithtag:100+i];
button. selected =NO;
}
Btn. selected =YES;
Self . SelectedIndex = btn. Tag-+;
As shown in the code above, the problem is to find the button according to the tag value when the original I was looking for from Self.view, and button on the BOTTOMBG,BOTTOMBG on Self.view, indirectly find I think there is no problem, but really not.
So it is best to find the control by tag value directly from the parent class control, there is no problem. Specifically why, too specific reasons I do not understand, who knows can guide ~
Self-customizing Tabbar click on different pages will be multiple simultaneous lighting situation