CNDownSlideViewRemindView.swift 2.31 KB
//
//  CNDownSlideViewRemindView.swift
//  metaCode
//
//  Created by daojian on 2023/5/31.
//

import Foundation
import YYCategories

///下滑显示提醒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)
    }
}