iOS|iOS 自定义uiprogress和uislider
1.uislider 那个圆形太大了叫ui切个图就行了[selfsetThumbImage:[UIImageimageNamed:@"slider_icon"]forState:UIControlStateNormal]
2.有个特别的需求就这样写了 遍历uiprogress uimageView再根据需求设置
- (void)awakeFromNib
{
[superawakeFromNib];
self.progressTintColor= [UIColorwhiteColor];
// 设置已过进度部分的颜色
self.trackTintColor= [UIColorblackColor];
// 设置未过进度部分的颜色
self.progress=0.0;
// 设置初始值,范围在0.0-1.0之间,默认是0.0
inti=0;
for(UIImageView* imageview in self.subviews)
【iOS|iOS 自定义uiprogress和uislider】{
i++;
if(i==1)
{
imageview.layer.borderColor=[UIColorwhiteColor].CGColor;
imageview.layer.borderWidth=0.5f;
}else
{
imageview.layer.borderColor=[UIColorwhiteColor].CGColor;
imageview.layer.borderWidth=1.f;
imageview.transform=CGAffineTransformMakeScale(1.0f,1.1f);
}
imageview.layer.cornerRadius=5;
imageview.clipsToBounds=YES;
}
}
推荐阅读
- 2020-04-07vue中Axios的封装和API接口的管理
- SpringBoot调用公共模块的自定义注解失效的解决
- python自定义封装带颜色的logging模块
- iOS中的Block
- 列出所有自定义的function和view
- 记录iOS生成分享图片的一些问题,根据UIView生成固定尺寸的分享图片
- 2019-08-29|2019-08-29 iOS13适配那点事
- Hacking|Hacking with iOS: SwiftUI Edition - SnowSeeker 项目(一)
- iOS面试题--基础
- 接口|axios接口报错-参数类型错误解决