Commit 839c9c69 authored by Steven杜宇's avatar Steven杜宇

// 添加信息cell

parent fc5aa989
......@@ -13,6 +13,7 @@
041B528F2B5E620E007EBCEB /* YHSingleLineInputCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */; };
041B52912B5E67F3007EBCEB /* YHSingleLineSelectCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */; };
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */; };
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */; };
0468D4202B49320900CFB916 /* YHVerificationCodeLoginController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */; };
0468D4222B493A5E00CFB916 /* YHPhoneMessageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */; };
0468D4242B494BEA00CFB916 /* YHCodeResultViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */; };
......@@ -148,6 +149,7 @@
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineInputCell.swift; sourceTree = "<group>"; };
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHSingleLineSelectCell.swift; sourceTree = "<group>"; };
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormTitleCell.swift; sourceTree = "<group>"; };
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHFormAddInfoCell.swift; sourceTree = "<group>"; };
0468D41F2B49320900CFB916 /* YHVerificationCodeLoginController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHVerificationCodeLoginController.swift; sourceTree = "<group>"; };
0468D4212B493A5E00CFB916 /* YHPhoneMessageView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHPhoneMessageView.swift; sourceTree = "<group>"; };
0468D4232B494BEA00CFB916 /* YHCodeResultViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = YHCodeResultViewController.swift; sourceTree = "<group>"; };
......@@ -305,6 +307,7 @@
041B528E2B5E620E007EBCEB /* YHSingleLineInputCell.swift */,
041B52902B5E67F3007EBCEB /* YHSingleLineSelectCell.swift */,
041B52922B5E6CBA007EBCEB /* YHFormTitleCell.swift */,
041B52942B5E7037007EBCEB /* YHFormAddInfoCell.swift */,
);
path = View;
sourceTree = "<group>";
......@@ -939,6 +942,7 @@
A5ACE9542B4564F7002C94D2 /* YHNavigationController.swift in Sources */,
A5ACE95E2B4571BF002C94D2 /* YHHomeViewController.swift in Sources */,
041B52932B5E6CBA007EBCEB /* YHFormTitleCell.swift in Sources */,
041B52952B5E7037007EBCEB /* YHFormAddInfoCell.swift in Sources */,
A5ACE93D2B4564F7002C94D2 /* UIButton+Extension.swift in Sources */,
041B528D2B5E58FA007EBCEB /* YHDoubleChoiceFormCell.swift in Sources */,
A5ACE9292B4564F7002C94D2 /* YHSmsCodeInputView.swift in Sources */,
......
//
// YHFormAddInfoCell.swift
// galaxy
//
// Created by edy on 2024/1/22.
// Copyright © 2024 https://www.galaxy-immi.com. All rights reserved.
//
import UIKit
class YHFormAddInfoCell: UITableViewCell {
static let cellReuseIdentifier = "YHFormAddInfoCell"
let btnTitleColor = UIColor(hexString:"#4388FF")
let btnHeight = 44.0
let cornerRadius = 4.0
lazy var addBtn: UIButton = {
let btn = UIButton.bs_button(title: "新增信息", font: UIFont.PFSCR(ofSize: 14), normalColor: btnTitleColor)
btn.iconInLeft(spacing: 10)
btn.setImage(UIImage(named: "form_add_info"), for: .normal)
btn.addTarget(self, action: #selector(didClickAddBtn), for: .touchUpInside)
return btn
}()
lazy var dotLineLayer:CAShapeLayer = {
let borderLayer = CAShapeLayer()
borderLayer.position = CGPoint(x: addBtn.bounds.midX, y: addBtn.bounds.midY);
borderLayer.path = UIBezierPath(roundedRect: borderLayer.bounds, cornerRadius: addBtn.layer.cornerRadius).cgPath
borderLayer.lineWidth = 1
//[数组第一个数字表示单个虚线长度,第二个数字表示间隔]
borderLayer.lineDashPattern = [3,1] as [NSNumber]?
//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase = 0.1
//实线边框
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = btnTitleColor.cgColor
return borderLayer
}()
required init?(coder: NSCoder) {
super.init(coder: coder)
}
override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
super.init(style: style, reuseIdentifier: reuseIdentifier)
setupUI()
}
func setupUI() {
self.selectionStyle = .none
contentView.addSubview(addBtn)
addBtn.layer.addSublayer(dotLineLayer)
addBtn.snp.makeConstraints { make in
make.left.top.equalToSuperview().offset(18)
make.right.bottom.equalToSuperview().offset(-18)
make.height.equalTo(btnHeight)
}
}
override func layoutSubviews() {
super.layoutSubviews()
print(addBtn.bounds)
dotLineLayer.path = UIBezierPath(roundedRect: addBtn.bounds, cornerRadius: cornerRadius).cgPath
}
@objc func didClickAddBtn() {
}
}
......@@ -37,4 +37,25 @@ extension UIView {
UIGraphicsEndImageContext()
return image
}
// 画虚线
func drawBorderDottedLine(width:CGFloat,length:CGFloat,space:CGFloat,cornerRadius:CGFloat,color:UIColor) {
self.layer.cornerRadius = cornerRadius
let borderLayer = CAShapeLayer()
borderLayer.bounds = self.bounds
borderLayer.position = CGPoint(x: self.bounds.midX, y: self.bounds.midY);
borderLayer.path = UIBezierPath(roundedRect: borderLayer.bounds, cornerRadius: cornerRadius).cgPath
borderLayer.lineWidth = width
//虚线边框---小边框的长度
borderLayer.lineDashPattern = [length,space] as [NSNumber]?
//前边是虚线的长度,后边是虚线之间空隙的长度
borderLayer.lineDashPhase = 0.1
//实线边框
borderLayer.fillColor = UIColor.clear.cgColor
borderLayer.strokeColor = color.cgColor
self.layer.addSublayer(borderLayer)
}
}
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
{
"images" : [
{
"filename" : "PlusOutlined.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment