CNUpSlideViewRemindView.swift
1.46 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
//
// CNUpSlideViewRemindView.swift
// metaCode
//
// Created by daojian on 2023/5/31.
//
import Foundation
/// 上拉显示提醒View
class CNUpSlideViewRemindView: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("#F0F5FD")?.cgColor
self.layer.addSublayer(bottomShapeLayer)
let imageView:UIImageView = UIImageView.init(image: UIImage(named: "homePage_up_icon"))
imageView.frame = CGRect(x: (self.width - 15)/2, y: 19, width: 15, height: 15)
self.addSubview(imageView)
let btn = UIButton(type: .custom)
btn.frame = CGRect(x: (self.width - 50)/2, y: imageView.bottom, 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)
}
}