for (int i = ; i < 4; i++) {//4是按钮的个数
NSString *backImage = backgroud[i];
NSString *heightImage = heightBackground[i]; UIButton *button = [UIFactory createButton:backImage highlighted:heightImage];
button.showsTouchWhenHighlighted = YES;
button.frame = CGRectMake(/ * i + , (-)/, , );//4是按钮的个数;25是自己不断修改得来的.
[button addTarget:self action:@selector(selectedTab:) forControlEvents:UIControlEventTouchUpInside];
[_tabbarView addSubview:button];
}
效果如图: