CNBottomPayMoneyRemindView.swift
1.25 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
//
// CNBottomPayMoneyRemindView.swift
// metaCode
//
// Created by daojian on 2023/5/31.
//
import Foundation
import YYCategories
/// 底部付钱上拉显示提醒View
class CNBottomPayMoneyRemindView:UIView{
override init(frame: CGRect) {
super.init(frame: frame)
self.initUI()
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
func initUI(){
let W = UIScreen.main.bounds.width - 100
let bottomCircle = UIBezierPath.init(arcCenter: CGPoint(x: W/2, y: W/2), radius: W/2, startAngle: 0, endAngle: .pi, clockwise: false)
let bottomShapeLayer = CAShapeLayer()
bottomShapeLayer.path = bottomCircle.cgPath
bottomShapeLayer.fillColor = UIColor("#FCE0E0")?.cgColor
self.layer.addSublayer(bottomShapeLayer)
let btn = UIButton(type: .custom)
btn.frame = CGRect(x: (self.width - 50)/2, y: 20, width: 50, height: 50)
btn.setTitle("付钱", for: .normal)
btn.setTitleColor(UIColor.red, for: .normal)
btn.titleLabel?.font = UIFont(name: "KohinoorTelugu-Regular", size: 17)
btn.isUserInteractionEnabled = false
self.addSubview(btn)
}
}