美文网首页
自定义UISlider样式

自定义UISlider样式

作者: u14e | 来源:发表于2017-07-08 21:32 被阅读107次
        UIImage *thumbImageNormal = [UIImage imageNamed:@"SliderThumb-Normal"];
        [self.slider setThumbImage:thumbImageNormal forState:UIControlStateNormal];
        
        UIImage *thumbImageHighlight = [UIImage imageNamed:@"SliderThumb-Highlight"];
        [self.slider setThumbImage:thumbImageHighlight forState:UIControlStateHighlighted];
        
        UIImage *trackLeftImage = [[UIImage imageNamed:@"SliderTrackLeft"] stretchableImageWithLeftCapWidth:14 topCapHeight:0];
        [self.slider setMinimumTrackImage:trackLeftImage forState:UIControlStateNormal];
        
        UIImage *trackRightImage = [[UIImage imageNamed:@"SliderTrackRight"] stretchableImageWithLeftCapWidth:14 topCapHeight:0];
        [self.slider setMaximumTrackImage:trackRightImage forState:UIControlStateNormal];
    

    相关文章

      网友评论

          本文标题:自定义UISlider样式

          本文链接:https://www.haomeiwen.com/subject/rimjhxtx.html