Commit 60af6240 authored by lujunye's avatar lujunye

添加payview未绑定按钮

parent 70168907
......@@ -9,46 +9,51 @@
import UIKit
class DZGLTableView: UITableView {
override func layoutSubviews() {
private var unifiedColor = UIColor.red
private lazy var deleteBtn: UIButton = {
let deleteBtn = UIButton(type: .custom)
deleteBtn.backgroundColor = unifiedColor
deleteBtn.setTitle("删除", for: .normal)
deleteBtn.setTitleColor(UIColor.white, for: .normal)
deleteBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
deleteBtn.setImage(UIImage(named: "shanchuWhite"), for: .normal)
return deleteBtn
}()
override func layoutSubviews() {
super.layoutSubviews()
if #available(iOS 11.0, *) {
for subview in self.subviews where subview.isKind(of: NSClassFromString("UISwipeActionPullView")!) {
subview.backgroundColor = UIColor(named: "#F57575")
for view in subview.subviews where view.isKind(of: NSClassFromString("UISwipeActionStandardButton")!) {
view.backgroundColor = UIColor(named: "#F57575")
let deleteBtn = setupDeleteBtn(frame: CGRect(x: 0, y: 0, width: 65, height: self.bounds.size.height))
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
}
for subview in self.subviews {
if subview.isKind(of: NSClassFromString("UISwipeActionPullView")!) {
subview.backgroundColor = unifiedColor
for view in subview.subviews {
if view.isKind(of: NSClassFromString("UISwipeActionStandardButton")!) {
view.backgroundColor = unifiedColor
let frame = CGRect(x: 0, y: 0, width: 80, height: view.bounds.size.height)
deleteBtn.frame = frame
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
break }
}
break }
}
} else { // IOS 10以及以下
for subview in subviews where subview.isKind(of: NSClassFromString("UITableViewCellDeleteConfirmationView")!) {
subview.backgroundColor = UIColor(named: "#F57575")
for view in subview.subviews where view.isKind(of: UIButton.self) {
view.backgroundColor = UIColor(named: "#F57575")
let deleteBtn = setupDeleteBtn(frame: view.frame)
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
}
for subview in subviews {
if subview.isKind(of: NSClassFromString("UITableViewCellDeleteConfirmationView")!) {
subview.backgroundColor = unifiedColor
for view in subview.subviews {
if view.isKind(of: UIButton.self) {
view.backgroundColor = unifiedColor
let frame = CGRect(x: 0, y: 0, width: 80, height: view.bounds.size.height)
deleteBtn.frame = frame
view.addSubview(deleteBtn)
view.bringSubviewToFront(deleteBtn)
break}
}
break}
}
}
}
}
private func setupDeleteBtn(frame: CGRect) -> UIButton {
let deleteBtn = UIButton(type: .custom)
deleteBtn.frame = frame
deleteBtn.backgroundColor = UIColor(named: "#F57575")
deleteBtn.setImage(UIImage(named: "shanchuWhite"), for: .normal)
return deleteBtn
}
}
......@@ -278,7 +278,7 @@
<color red="0.3880000114440918" green="0.62400001287460327" blue="0.90200001001358032" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="按钮渐变色下,字体颜色">
<color red="0.27450980392156865" green="0.5607843137254902" blue="0.88627450980392153" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.27843137254901962" green="0.5607843137254902" blue="0.8901960784313725" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="未登录提示背景色">
<color red="1" green="0.43900001049041748" blue="0.43900001049041748" alpha="0.64999997615814209" colorSpace="custom" customColorSpace="sRGB"/>
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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="16086"/>
<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"/>
......@@ -174,7 +174,7 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
......@@ -11,6 +11,7 @@ import LGButton
class PayViewController: BaseViewController {
@IBOutlet weak var enterBtnFrameBtn: UIButton!
@IBOutlet weak var enterBtn: LGButton!
@IBOutlet weak var changeBindBtn: UIButton!
@IBOutlet weak var pinkView: UIView!
......@@ -56,11 +57,11 @@ class PayViewController: BaseViewController {
changeBindBtn.isHidden = true
}
if navbar.title == "支付账号" {
passBtn.setTitle("修改支付密码", for: .normal)
}else{
passBtn.setTitle("设置支付密码", for: .normal)
}
// if navbar.title == "支付账号" {
// passBtn.setTitle("修改支付密码", for: .normal)
// }else{
// passBtn.setTitle("设置支付密码", for: .normal)
// }
pinkView.snp.makeConstraints { (make) in
make.top.equalTo(NavCGRect.height)
......
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="16096" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
<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="16086"/>
<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"/>
......@@ -13,6 +13,7 @@
<outlet property="accountLbl" destination="8zk-ru-La4" id="sNs-yx-2VH"/>
<outlet property="changeBindBtn" destination="ZQU-rH-u77" id="TE7-D6-7Qr"/>
<outlet property="enterBtn" destination="dpm-28-Ljh" id="NR6-u2-KbX"/>
<outlet property="enterBtnFrameBtn" destination="4Jc-QV-Bqa" id="YLi-Cz-IgY"/>
<outlet property="passBtn" destination="aJE-2M-4y3" id="oWF-if-08i"/>
<outlet property="pinkView" destination="5ip-zi-hlC" id="Yt8-rj-o8p"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
......@@ -117,7 +118,7 @@
<constraint firstAttribute="height" constant="44" id="eSu-6w-UFn"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<state key="normal" title="设置支付密码">
<state key="normal" title="修改支付密码">
<color key="titleColor" name="按钮渐变色下,字体颜色"/>
</state>
<userDefinedRuntimeAttributes>
......@@ -159,19 +160,44 @@
<action selector="bindAction:" destination="-1" eventType="touchUpInside" id="wlJ-Er-lbb"/>
</connections>
</button>
<button hidden="YES" opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4Jc-QV-Bqa">
<rect key="frame" x="37.5" y="193" width="339" height="44"/>
<constraints>
<constraint firstAttribute="height" constant="44" id="2Io-16-xFS"/>
</constraints>
<fontDescription key="fontDescription" name=".AppleSystemUIFont" family=".AppleSystemUIFont" pointSize="17"/>
<state key="normal" title="未绑定">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="5"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" name="蓝色字体颜色"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="number" keyPath="borderWidth">
<real key="value" value="1"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<constraints>
<constraint firstItem="ZQU-rH-u77" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="0We-Ts-fZc"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="ZQU-rH-u77" secondAttribute="trailing" constant="37.5" id="1jG-xm-6oQ"/>
<constraint firstItem="4Jc-QV-Bqa" firstAttribute="centerY" secondItem="dpm-28-Ljh" secondAttribute="centerY" id="AUf-CT-Q48"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="4Jc-QV-Bqa" secondAttribute="trailing" constant="37.5" id="KBz-u5-DiY"/>
<constraint firstItem="Rgd-rh-pDk" firstAttribute="top" secondItem="5ip-zi-hlC" secondAttribute="bottom" constant="-22.5" id="PCc-Zy-jgd"/>
<constraint firstItem="dpm-28-Ljh" firstAttribute="top" secondItem="Rgd-rh-pDk" secondAttribute="bottom" constant="100" id="PKh-DP-mhF"/>
<constraint firstItem="aJE-2M-4y3" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="PTM-cu-Nar"/>
<constraint firstItem="5ip-zi-hlC" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" id="Pv6-ef-Loz"/>
<constraint firstItem="ZQU-rH-u77" firstAttribute="top" secondItem="aJE-2M-4y3" secondAttribute="bottom" constant="20" id="Tso-WV-zMV"/>
<constraint firstItem="5ip-zi-hlC" firstAttribute="top" secondItem="fnl-2z-Ty3" secondAttribute="top" id="UgE-Fv-elX"/>
<constraint firstItem="4Jc-QV-Bqa" firstAttribute="centerX" secondItem="dpm-28-Ljh" secondAttribute="centerX" id="ak4-bw-Luq"/>
<constraint firstItem="dpm-28-Ljh" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="eBS-Fp-aTa"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="5ip-zi-hlC" secondAttribute="trailing" id="jaP-ca-fur"/>
<constraint firstItem="4Jc-QV-Bqa" firstAttribute="leading" secondItem="fnl-2z-Ty3" secondAttribute="leading" constant="37.5" id="mMt-4D-EFf"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="dpm-28-Ljh" secondAttribute="trailing" constant="37.5" id="p4a-ll-Ibx"/>
<constraint firstItem="fnl-2z-Ty3" firstAttribute="trailing" secondItem="aJE-2M-4y3" secondAttribute="trailing" constant="37.5" id="shk-vI-E99"/>
<constraint firstItem="aJE-2M-4y3" firstAttribute="top" secondItem="dpm-28-Ljh" secondAttribute="bottom" constant="20" id="vlV-WR-Sjm"/>
......@@ -196,10 +222,13 @@
<color red="0.18000000715255737" green="0.18000000715255737" blue="0.18000000715255737" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="灰色字体颜色">
<color red="0.40000000596046448" green="0.40000000596046448" blue="0.40000000596046448" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<color red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="白色背景色">
<color red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
<namedColor name="蓝色字体颜色">
<color red="0.27799999713897705" green="0.56099998950958252" blue="0.88999998569488525" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor>
</resources>
</document>
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