VipLessonTableHeaderView.m 952 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. //
  2. // VipLessonTableHeaderView.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2019/6/26.
  6. // Copyright © 2019 JCZ. All rights reserved.
  7. //
  8. #import "VipLessonTableHeaderView.h"
  9. @interface VipLessonTableHeaderView ()
  10. @end
  11. @implementation VipLessonTableHeaderView
  12. - (void)awakeFromNib {
  13. [super awakeFromNib];
  14. [super drawRect:CGRectZero];
  15. }
  16. - (void)drawRect:(CGRect)rect {
  17. CGFloat R = kScreenWidth / 2.0;
  18. CGContextRef context = UIGraphicsGetCurrentContext();
  19. //背景颜色设置
  20. [[UIColor whiteColor] set];
  21. CGContextFillRect(context, rect);
  22. //填充颜色
  23. CGContextSetFillColorWithColor(context, RGB_COLOR(84, 207, 119).CGColor);
  24. CGContextAddArc(context, R, -(R * (7.0 / 6.0)), 2*R, (90 * M_PI / 180), (-360 * M_PI / 180), 1);//如果圆弧是顺时针画的,“clockwise”是1,否则是0;
  25. CGContextDrawPath(context, kCGPathFillStroke);
  26. }
  27. - (IBAction)signUpBtnAction:(id)sender {
  28. _notVipView.hidden = !_notVipView.hidden;
  29. }
  30. @end