要更改 TTTabStrip 的样式,我执行了以下操作:
1) 创建自定义样式,即从 TTDefaultStyleSheet 扩展的类
2) 覆盖 tabStrib 方法。例如,我使用灰色渐变作为背景,代码如下:
- (TTStyle*)tabStrip {
UIColor* border = RGBCOLOR(130, 130, 130);
return
[TTBevelBorderStyle styleWithColor:[UIColor whiteColor] width:1.0f next:
[TTLinearGradientFillStyle styleWithColor1:RGBCOLOR(130, 130, 130) color2:RGBCOLOR(67, 67, 67) next:
[TTFourBorderStyle styleWithTop:border right:nil bottom:nil left:nil width:1 next:nil]]];}
3)注册您的自定义样式,使用setGlobalStyleSheet
4) 观察结果并开始咒骂,因为溢出箭头现在不再匹配了 :)
5) 以您的图像的方式覆盖您的自定义样式中的- (TTStyle*)tabOverflowLeft
and ,以匹配背景,返回。- (TTStyle*)tabOverflowRight
如果你们想出更好的方法,请告诉我:)