Commit 8231d84b authored by lujunye's avatar lujunye

寄派时间选择

parent 6030cee4
......@@ -18,6 +18,10 @@
E01C26B12446989700ADCC70 /* Interface_Z.plist in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B02446989700ADCC70 /* Interface_Z.plist */; };
E01C26B62446AF3100ADCC70 /* DemoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E01C26B42446AF3100ADCC70 /* DemoViewController.swift */; };
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E01C26B52446AF3100ADCC70 /* DemoViewController.xib */; };
E0273DD824551B4C00B3FCAE /* SendTimeSelectView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */; };
E0273DDA24551B6D00B3FCAE /* SendTimeSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */; };
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */; };
E0273DDE24551D4500B3FCAE /* OnlyLabelCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0273DDC24551D4500B3FCAE /* OnlyLabelCell.xib */; };
E02DDD83244FD15B00ABB707 /* TitleAndSwitchHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02DDD82244FD15B00ABB707 /* TitleAndSwitchHeaderView.xib */; };
E02DDD85244FDC6A00ABB707 /* TitleAndSwitchHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E02DDD84244FDC6A00ABB707 /* TitleAndSwitchHeaderView.swift */; };
E02DDD8B244FE17400ABB707 /* NewCreateFooter.xib in Resources */ = {isa = PBXBuildFile; fileRef = E02DDD8A244FE17400ABB707 /* NewCreateFooter.xib */; };
......@@ -236,6 +240,10 @@
E01C26B42446AF3100ADCC70 /* DemoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DemoViewController.swift; sourceTree = "<group>"; };
E01C26B52446AF3100ADCC70 /* DemoViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = DemoViewController.xib; sourceTree = "<group>"; };
E01C26BA2446D68500ADCC70 /* Bridge_Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Bridge_Header.h; sourceTree = "<group>"; };
E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SendTimeSelectView.swift; sourceTree = "<group>"; };
E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SendTimeSelectView.xib; sourceTree = "<group>"; };
E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnlyLabelCell.swift; sourceTree = "<group>"; };
E0273DDC24551D4500B3FCAE /* OnlyLabelCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = OnlyLabelCell.xib; sourceTree = "<group>"; };
E02DDD82244FD15B00ABB707 /* TitleAndSwitchHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = TitleAndSwitchHeaderView.xib; sourceTree = "<group>"; };
E02DDD84244FDC6A00ABB707 /* TitleAndSwitchHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleAndSwitchHeaderView.swift; sourceTree = "<group>"; };
E02DDD8A244FE17400ABB707 /* NewCreateFooter.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewCreateFooter.xib; sourceTree = "<group>"; };
......@@ -817,6 +825,8 @@
children = (
E09F4C9B2452BEBB00BE033D /* JiPaiFangShiViewController.swift */,
E09F4C9C2452BEBB00BE033D /* JiPaiFangShiViewController.xib */,
E0273DD724551B4C00B3FCAE /* SendTimeSelectView.swift */,
E0273DD924551B6D00B3FCAE /* SendTimeSelectView.xib */,
);
path = "寄派方式";
sourceTree = "<group>";
......@@ -978,6 +988,8 @@
E042F7372452766100CDFA12 /* AdressSelectCell.xib */,
E042F73E24528CD500CDFA12 /* TitleAndOnlyBtnCell.swift */,
E042F73F24528CD500CDFA12 /* TitleAndOnlyBtnCell.xib */,
E0273DDB24551D4500B3FCAE /* OnlyLabelCell.swift */,
E0273DDC24551D4500B3FCAE /* OnlyLabelCell.xib */,
);
path = Cell;
sourceTree = "<group>";
......@@ -1274,6 +1286,7 @@
E02DDD83244FD15B00ABB707 /* TitleAndSwitchHeaderView.xib in Resources */,
F950FDB12451811A00C40530 /* TitleAndSelCalendarView.xib in Resources */,
E0B6036F244D376900A56B38 /* KuWeiCell.xib in Resources */,
E0273DDA24551B6D00B3FCAE /* SendTimeSelectView.xib in Resources */,
E01C26B72446AF3100ADCC70 /* DemoViewController.xib in Resources */,
E0F97B0424512299001BD600 /* GLAlertSelectView.xib in Resources */,
E0C4F4BA244EEA7C00CC7E2F /* JiaTiJiaCell.xib in Resources */,
......@@ -1323,6 +1336,7 @@
E0F97B1B2451951D001BD600 /* ShangPinGguiGeCell.xib in Resources */,
E0336DD6244EC40000380BE9 /* CreatNewSpecsViewController.xib in Resources */,
E0C4F4B6244EE9EE00CC7E2F /* YuShouCell.xib in Resources */,
E0273DDE24551D4500B3FCAE /* OnlyLabelCell.xib in Resources */,
E00D85E5244561FE00F5F816 /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -1450,6 +1464,7 @@
E0D4166424483058008DCAB4 /* ChangePassViewController.swift in Sources */,
F933F6C12452C68B00189561 /* PKHUDAnimation.swift in Sources */,
E0C4F4A7244EC82A00CC7E2F /* TitleAndBtnCell.swift in Sources */,
E0273DDD24551D4500B3FCAE /* OnlyLabelCell.swift in Sources */,
F950FDD724518B9500C40530 /* FSCalendarCollectionView.m in Sources */,
E09B03C62445BF6700211A51 /* NavBarView.swift in Sources */,
E0C9EF12244E922200277435 /* OrderDViewController.swift in Sources */,
......@@ -1460,6 +1475,7 @@
E00D85E1244561FD00F5F816 /* SceneDelegate.swift in Sources */,
F950FDDA24518B9500C40530 /* FSCalendarCell.m in Sources */,
F969BF1E244EE67900C79953 /* GoodsManageListVC.swift in Sources */,
E0273DD824551B4C00B3FCAE /* SendTimeSelectView.swift in Sources */,
E09B03A12445AF7100211A51 /* Define.swift in Sources */,
F961D271245016B7007FBE70 /* SelectContentView.swift in Sources */,
F933F6C02452C68B00189561 /* PKHUDSystemActivityIndicatorView.swift in Sources */,
......
//
// OnlyLabelCell.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/26.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class OnlyLabelCell: UITableViewCell {
@IBOutlet weak var titleLbl: UILabel!
override func awakeFromNib() {
super.awakeFromNib()
self.selectionStyle = .none
// Initialization code
}
override func setSelected(_ selected: Bool, animated: Bool) {
super.setSelected(selected, animated: animated)
// Configure the view for the selected state
}
}
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="15702" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<device id="retina6_1" orientation="portrait" appearance="light"/>
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="15704"/>
<capability name="Named colors" minToolsVersion="9.0"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="OnlyLabelCell" customModule="GeliBusinessPlatform" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="PGg-2c-xG9">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="灰色字体颜色"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="PGg-2c-xG9" secondAttribute="trailing" id="Wdb-AY-JeG"/>
<constraint firstAttribute="bottom" secondItem="PGg-2c-xG9" secondAttribute="bottom" id="gb0-8T-Yax"/>
<constraint firstItem="PGg-2c-xG9" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="hX9-km-Q7T"/>
<constraint firstItem="PGg-2c-xG9" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" id="qzK-TZ-hi7"/>
</constraints>
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="njF-e1-oar"/>
<connections>
<outlet property="titleLbl" destination="PGg-2c-xG9" id="bfJ-sY-psB"/>
</connections>
<point key="canvasLocation" x="132" y="122"/>
</tableViewCell>
</objects>
<resources>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -56,10 +56,10 @@
</objects>
<resources>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -11,9 +11,16 @@ import UIKit
class JiTuoWuXinXiView: UIView {
var contentView:UIView!
@IBOutlet weak var infoSw: UISwitch!
@IBOutlet weak var bottomView: UIView!
func setUI(){
infoSw.transform = CGAffineTransform(scaleX: 0.8, y: 0.8)
let maskPath = UIBezierPath(roundedRect: bottomView.bounds,
byRoundingCorners:[.topLeft, .topRight], cornerRadii:CGSize(width:3, height:3))
let masklayer = CAShapeLayer()
masklayer.frame = bottomView.bounds
masklayer.path = maskPath.cgPath
bottomView.layer.mask = masklayer
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
......
......@@ -10,6 +10,7 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="JiTuoWuXinXiView" customModule="GeliBusinessPlatform" customModuleProvider="target">
<connections>
<outlet property="bottomView" destination="rW2-Ka-gAx" id="QZC-w2-eDD"/>
<outlet property="infoSw" destination="n6W-Cn-03r" id="7Cp-xO-kfJ"/>
</connections>
</placeholder>
......
......@@ -162,7 +162,7 @@
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......
......@@ -206,16 +206,16 @@
<color red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="标题字颜色">
<color red="0.1803921568627451" green="0.1803921568627451" blue="0.1803921568627451" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -45,7 +45,6 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
print("submit")
}
var titleArr = ["送货入仓","清真","易污染"]
@IBOutlet weak var topView: UIView!
@IBOutlet weak var nBtn: UIButton!
......@@ -59,6 +58,7 @@ class ZengZhiServicesViewController: BaseViewController,UITableViewDelegate,UITa
@IBOutlet weak var inputTF: UITextField!
@IBOutlet weak var holderLbl: UILabel!
@IBOutlet weak var listView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "增值服务"
......
......@@ -10,7 +10,11 @@ import UIKit
class JiPaiFangShiViewController: BaseViewController {
@IBOutlet weak var timeView: UIView!
@IBAction func selectTimeAction(_ sender: UIButton) {
let view = SendTimeSelectView(frame:self.view.bounds)
self.view.addSubview(view)
}
@IBOutlet weak var topView: UIView!
@IBOutlet weak var PLBL: UILabel!
@IBOutlet weak var JLBL: UILabel!
......
......@@ -28,17 +28,17 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Gkh-Nb-hzF">
<rect key="frame" x="15" y="114" width="384" height="0.0"/>
<rect key="frame" x="15" y="114" width="384" height="45"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="jinru" translatesAutoresizingMaskIntoConstraints="NO" id="xnQ-Lb-T7k">
<rect key="frame" x="364" y="-29" width="5" height="9"/>
<rect key="frame" x="364" y="16" width="5" height="9"/>
<constraints>
<constraint firstAttribute="height" constant="9" id="btx-fk-F37"/>
<constraint firstAttribute="width" constant="5" id="mKv-OP-Izj"/>
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="今天 14:30~16:30" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="DPN-ah-dAM">
<rect key="frame" x="159" y="-32" width="200" height="15"/>
<rect key="frame" x="159" y="13" width="200" height="15"/>
<constraints>
<constraint firstAttribute="width" constant="200" id="5kN-KW-gI7"/>
<constraint firstAttribute="height" constant="15" id="aBm-a5-s8p"/>
......@@ -48,7 +48,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="期望上门时间:" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kam-ox-WNt">
<rect key="frame" x="30" y="-32.5" width="100" height="16"/>
<rect key="frame" x="30" y="12.5" width="100" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="Zjo-pz-hgO"/>
<constraint firstAttribute="width" constant="100" id="dYP-RR-IVs"/>
......@@ -57,15 +57,28 @@
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ISo-si-dxb">
<rect key="frame" x="130" y="0.0" width="254" height="45"/>
<state key="normal">
<color key="titleColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
</state>
<connections>
<action selector="selectTimeAction:" destination="-1" eventType="touchUpInside" id="b9c-D1-0Aw"/>
</connections>
</button>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstAttribute="height" constant="0.01" id="1U5-hJ-N6K"/>
<constraint firstAttribute="height" constant="45" id="1U5-hJ-N6K"/>
<constraint firstItem="kam-ox-WNt" firstAttribute="centerY" secondItem="DPN-ah-dAM" secondAttribute="centerY" id="6Zv-ZY-dVV"/>
<constraint firstItem="kam-ox-WNt" firstAttribute="leading" secondItem="Gkh-Nb-hzF" secondAttribute="leading" constant="30" id="Atf-jG-6PT"/>
<constraint firstItem="DPN-ah-dAM" firstAttribute="centerY" secondItem="xnQ-Lb-T7k" secondAttribute="centerY" id="Byo-iQ-eVK"/>
<constraint firstAttribute="bottom" secondItem="ISo-si-dxb" secondAttribute="bottom" id="GTc-gK-dIP"/>
<constraint firstItem="ISo-si-dxb" firstAttribute="leading" secondItem="kam-ox-WNt" secondAttribute="trailing" id="Ioq-tr-fjs"/>
<constraint firstAttribute="trailing" secondItem="ISo-si-dxb" secondAttribute="trailing" id="Q0j-5T-LSB"/>
<constraint firstAttribute="trailing" secondItem="xnQ-Lb-T7k" secondAttribute="trailing" constant="15" id="QUu-wd-hMk"/>
<constraint firstItem="xnQ-Lb-T7k" firstAttribute="leading" secondItem="DPN-ah-dAM" secondAttribute="trailing" constant="5" id="XS9-ja-ycc"/>
<constraint firstItem="ISo-si-dxb" firstAttribute="top" secondItem="Gkh-Nb-hzF" secondAttribute="top" id="l4I-eA-SNr"/>
<constraint firstAttribute="bottom" secondItem="xnQ-Lb-T7k" secondAttribute="bottom" constant="20" id="nGH-a9-SBk"/>
</constraints>
</view>
......@@ -177,7 +190,7 @@
</userDefinedRuntimeAttributes>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="Ul1-px-ztN">
<rect key="frame" x="15" y="129" width="384" height="57"/>
<rect key="frame" x="15" y="174" width="384" height="57"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="派" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Hgj-Lr-BmC">
<rect key="frame" x="0.0" y="18.5" width="20" height="20"/>
......
//
// TimeSelectView.swift
// GeliBusinessPlatform
//
// Created by junye lu on 2020/4/26.
// Copyright © 2020 junye lu. All rights reserved.
//
import UIKit
class SendTimeSelectView: UIView,UITableViewDelegate,UITableViewDataSource {
let leftListArr = ["今天","明天","后天"]
let rightListArr = ["1","2","3"]
var contentView:UIView!
@IBAction func submitAction(_ sender: Any) {
}
@IBOutlet weak var rightListView: UITableView!
@IBOutlet weak var leftListView: UITableView!
@IBOutlet weak var bottomView: UIView!
func setUI(){
let maskPath = UIBezierPath(roundedRect: bottomView.bounds,
byRoundingCorners:[.topLeft, .topRight], cornerRadii:CGSize(width:3, height:3))
let masklayer = CAShapeLayer()
masklayer.frame = bottomView.bounds
masklayer.path = maskPath.cgPath
bottomView.layer.mask = masklayer
leftListView.separatorStyle = .none
rightListView.separatorStyle = .none
leftListView.register(UINib(nibName: "OnlyLabelCell", bundle: nil), forCellReuseIdentifier: "OnlyLabel")
rightListView.register(UINib(nibName: "OnlyLabelCell", bundle: nil), forCellReuseIdentifier: "OnlyLabel")
tableView(leftListView, didSelectRowAt: IndexPath(row: 0, section: 0))
leftListView.reloadData()
}
//初始化时将xib中的view添加进来
override init(frame: CGRect) {
super.init(frame: frame)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
self.setUI()
}
// /初始化时将xib中的view添加进来
required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
contentView = loadViewFromNib()
addSubview(contentView)
contentView.snp.makeConstraints { (make) in
make.left.top.right.bottom.equalToSuperview()
}
self.setUI()
}
//加载xib
func loadViewFromNib() -> UIView {
let className = type(of: self)
let bundle = Bundle(for: className)
let name = NSStringFromClass(className).components(separatedBy: ".").last
let nib = UINib(nibName: name!, bundle: bundle)
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
self.setUI()
return view
}
//MARK: - CELL DELEGATE
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView == leftListView {
return leftListArr.count
}
return 3
}
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 49
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "OnlyLabel") as! OnlyLabelCell
cell.tag = indexPath.row
cell.titleLbl.text = rightListArr[indexPath.row]
if tableView == leftListView {
cell.titleLbl.text = leftListArr[indexPath.row]
}
return cell
}
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
if tableView == leftListView {
//
//cell状态效果
for item in leftListView.visibleCells {
let cel = item as! OnlyLabelCell
cel.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cel.titleLbl.font = UIFont.systemFont(ofSize: 13)
cel.backgroundColor = UIColor(named: "搜索框背景色")
if cel.tag == indexPath.row {
cel.titleLbl.textColor = UIColor(named: "标题字颜色")
cel.titleLbl.font = UIFont.boldSystemFont(ofSize: 13)
cel.backgroundColor = UIColor.white
}
}
}
if tableView == rightListView {
//
//cell状态效果
for item in rightListView.visibleCells {
let cel = item as! OnlyLabelCell
cel.titleLbl.textColor = UIColor(named: "灰色字体颜色")
cel.titleLbl.font = UIFont.systemFont(ofSize: 13)
if cel.tag == indexPath.row {
cel.titleLbl.textColor = UIColor(named: "蓝色字体颜色")
cel.titleLbl.font = UIFont.systemFont (ofSize: 13)
}
}
}
}
}
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