CNDownSlideViewRemindView.swift
2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// CNDownSlideViewRemindView.swift
// metaCode
//
// Created by daojian on 2023/5/31.
//
import Foundation
///下滑显示提醒View
class CNDownSlideViewRemindView : UIView{
override init(frame: CGRect) {
super.init(frame: frame)
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
// CGFloat W = kScreenWidth - 100;
// UIBezierPath *bottomCircle = [UIBezierPath bezierPathWithArcCenter:CGPointMake(W/2, 0) radius:W/2 startAngle:0 endAngle:M_PI clockwise:YES];
// CAShapeLayer *bottomShapeLayer = [[CAShapeLayer alloc] init];
// bottomShapeLayer.path = bottomCircle.CGPath;
// bottomShapeLayer.fillColor = CNLiveColorWithHexString(@"#F5F5F5").CGColor;
//
// [self.layer addSublayer:bottomShapeLayer];
//
// UIButton *btn =[UIButton buttonWithType:UIButtonTypeCustom];
// btn.frame = CGRectMake((self.width - 50)/2, self.height-70, 50, 50);
// [btn setTitle:@"收钱" forState:UIControlStateNormal];
// [btn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
// btn.titleLabel.font = [UIFont systemFontOfSize:17];
// btn.userInteractionEnabled = NO;
let W = UIScreen.main.bounds.width - 100
let bottomCircle = UIBezierPath.init(arcCenter: CGPoint(x: W/2, y: 0), radius: W/2, startAngle: 0, endAngle: .pi, clockwise: true)
let bottomShapeLayer = CAShapeLayer()
bottomShapeLayer.path = bottomCircle.cgPath
bottomShapeLayer.fillColor = UIColor("#F0F5FD")?.cgColor
self.layer.addSublayer(bottomShapeLayer)
let btn = UIButton(type: .custom)
btn.frame = CGRect(x: (self.width - 50)/2, y: self.height-70, width: 50, height: 25)
btn.setTitle("下滑", for: .normal)
btn.setTitleColor(UIColor("#004FE0"), for: .normal)
btn.titleLabel?.font = UIFont(name: "KohinoorTelugu-Regular", size: 17)
btn.isUserInteractionEnabled = false
self.addSubview(btn)
let imageView:UIImageView = UIImageView.init(image: UIImage(named: "homePage_down_icon"))
imageView.frame = CGRect(x: (self.width - 15)/2, y: btn.bottom, width: 15, height: 15)
self.addSubview(imageView)
}
}