123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // TSViewTool.swift
- // TSLiveWallpaper
- //
- // Created by 100Years on 2024/12/20.
- //
- class TSViewTool: UIView {
-
- }
- func createBlurEffectView(style:UIBlurEffect.Style,backgroundColor:UIColor? = nil) -> UIVisualEffectView {
- let blurEffect = UIBlurEffect(style: style)
- let blurEffectView = UIVisualEffectView(effect: blurEffect)
- blurEffectView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
-
- if backgroundColor != nil {
- blurEffectView.backgroundColor = backgroundColor
- }
-
- return blurEffectView
- }
- //常用提交按钮
- func kCreateNormalSubmitBtn(title:String, action: (() -> Void)? = nil) -> UIButton {
-
- let btn = TSNormalSubmitBtn()
- btn.setUpButton(title:title,font: UIFont.font(size: 16,weight: .regular),titleColor:.white,corner: 24,action: action)
- btn.contentEdgeInsets = UIEdgeInsets(top: 0, left: 8, bottom: 0, right: 0)
- btn.imageEdgeInsets = UIEdgeInsets(top:0, left: -8, bottom: 0, right: 16)
- btn.frame = CGRectMake(0, 0, 200, 48)
- btn.addGradientBg(colors: ["#E961F6".uiColor.cgColor,"#7E57F4".uiColor.cgColor])
- return btn
- }
- func kAddNormalSubmitGradientBg(view:UIView){
- kDelayMainShort {
- view.addGradientBg(colors: ["#E961F6".uiColor.cgColor,"#7E57F4".uiColor.cgColor])
- }
- }
- func kCreateMoreInfoBtn() -> UIButton{
- let btn = TSUIExpandedTouchButton()
- btn.setImage(UIImage(named: "more_info_white"), for: .normal)
- return btn
- }
- ////常用提交按钮
- //func kCreateNormalSubmitBtn(title:String, action: (() -> Void)? = nil) -> UIButton {
- // let btn = UIButton.createButton(title:title,backgroundColor: .black,font: UIFont.font(size: 16,weight: .regular),titleColor:.themeColor,corner: 24,action: action)
- // btn.layer.borderWidth = 1
- // btn.layer.borderColor = UIColor.themeColor.cgColor
- // btn.frame = CGRectMake(0, 0, 200, 48)
- // return btn
- //}
- ////常用取消按钮
- //func kCreateNormalCancelBtn(title:String, action: (() -> Void)? = nil) -> UIButton {
- // let btn = UIButton.createButton(title:title,backgroundColor: .fromHex("#FFFFFF", alpha: 0.4),font: UIFont.font(size: 14,weight: .medium),titleColor:.white,corner: 30,action: action)
- // return btn
- //}
- ////常用确定按钮
- //func kCreateNormalConfirmBtn(title:String, action: (() -> Void)? = nil) -> UIButton {
- // let btn = UIButton.createButton(title:title,backgroundImage:UIImage(named: "submit_btn_small_bg"),font: UIFont.font(size: 14,weight: .medium),titleColor:.white,corner: 30,action: action)
- // return btn
- //}
- let kPlaceholderImage = UIImage(named: "placeholderImage")
- let kViewBJ = "view_bj"
|