Commit c14609fa authored by lujunye's avatar lujunye

货拉拉点击跳转

parent 52b84f99
......@@ -94,6 +94,7 @@
E030DF372485DD3E002764D3 /* NewRKCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF352485DD3E002764D3 /* NewRKCell.xib */; };
E030DF3B248651A5002764D3 /* NewRKVc.swift in Sources */ = {isa = PBXBuildFile; fileRef = E030DF39248651A5002764D3 /* NewRKVc.swift */; };
E030DF3C248651A5002764D3 /* NewRKVc.xib in Resources */ = {isa = PBXBuildFile; fileRef = E030DF3A248651A5002764D3 /* NewRKVc.xib */; };
E0329EA424D808B1000D547E /* PayPassView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0329EA324D808B1000D547E /* PayPassView.swift */; };
E0336DD5244EC40000380BE9 /* CreatNewSpecsViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0336DD3244EC40000380BE9 /* CreatNewSpecsViewController.swift */; };
E0336DD6244EC40000380BE9 /* CreatNewSpecsViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E0336DD4244EC40000380BE9 /* CreatNewSpecsViewController.xib */; };
E0337EED2464EED000952EF4 /* PinPaiListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E0337EEB2464EED000952EF4 /* PinPaiListViewController.swift */; };
......@@ -706,6 +707,7 @@
E030DF352485DD3E002764D3 /* NewRKCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKCell.xib; sourceTree = "<group>"; };
E030DF39248651A5002764D3 /* NewRKVc.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NewRKVc.swift; sourceTree = "<group>"; };
E030DF3A248651A5002764D3 /* NewRKVc.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = NewRKVc.xib; sourceTree = "<group>"; };
E0329EA324D808B1000D547E /* PayPassView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PayPassView.swift; sourceTree = "<group>"; };
E0336DD3244EC40000380BE9 /* CreatNewSpecsViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CreatNewSpecsViewController.swift; sourceTree = "<group>"; };
E0336DD4244EC40000380BE9 /* CreatNewSpecsViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = CreatNewSpecsViewController.xib; sourceTree = "<group>"; };
E0337EEB2464EED000952EF4 /* PinPaiListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PinPaiListViewController.swift; sourceTree = "<group>"; };
......@@ -1907,6 +1909,7 @@
F9023F642449A3AE00DD5A63 /* Cell */,
F95D9B4E24484F140080D6E3 /* AlertView */,
E09B03C42445BF4600211A51 /* NavBarView */,
E0329EA324D808B1000D547E /* PayPassView.swift */,
);
path = View;
sourceTree = "<group>";
......@@ -3497,6 +3500,7 @@
E0571C6C248DC60000E85711 /* AddressListModel.swift in Sources */,
E0A2E82B24555D8600D6DB34 /* KuCunXiangQingCell.swift in Sources */,
F933F6C22452C68B00189561 /* PKHUDAnimating.swift in Sources */,
E0329EA424D808B1000D547E /* PayPassView.swift in Sources */,
E00E48C62457C99900F16545 /* KuCunShangPinXQViewController.swift in Sources */,
E02D586B2477A1480065A9EB /* GetAddrsInfoModel.swift in Sources */,
F9531F3C2465108800724BEE /* JXPhotoBrowserSmoothZoomAnimator.swift in Sources */,
......
import UIKit
//文本内容发生改变时调用
@objc protocol PasswordViewDelegate {
//文本发生改变(插入或删除)时调用
@objc optional func passwordView(textChanged: String, length: Int)
//输入完成(输入的长度与指定的密码最大长度相同)时调用
func passwordView(textFinished: String)
}
class PayPassView: UIView, UIKeyInput {
//输入的文本
private var text: NSMutableString = ""
//文本发生改变时的代理
var delegate: PasswordViewDelegate?
//密码最大长度
var maxLength: Int = 6
var hasText: Bool {
return text.length > 0
}
func insertText(_ text: String) {
if self.text.length < maxLength {
self.text.append(text)
delegate?.passwordView?(textChanged: self.text as String, length: self.text.length)
setNeedsDisplay()
if self.text.length == maxLength {
self.resignFirstResponder()
delegate?.passwordView(textFinished: self.text as String)
}
}
}
func deleteBackward() {
if self.text.length > 0 {
self.text.deleteCharacters(in: NSRange(location: text.length - 1, length: 1))
delegate?.passwordView?(textChanged: self.text as String, length: self.text.length)
setNeedsDisplay()
}
}
override func draw(_ rect: CGRect) {
guard let context = UIGraphicsGetCurrentContext() else { return }
let width = rect.width / CGFloat(maxLength) //每一个小格子的宽度
context.setStrokeColor(UIColor.lightGray.cgColor)
context.setLineWidth(1)
//外边框
context.stroke(rect)
let path = UIBezierPath()
//画中间分隔的竖线
(1..<maxLength).forEach { (index) in
path.move(to: CGPoint(x: rect.origin.x + CGFloat(index) * width, y: rect.origin.y))
path.addLine(to: CGPoint(x: rect.origin.x + CGFloat(index) * width, y: rect.origin.y + rect.height))
}
context.addPath(path.cgPath)
context.strokePath()
//画圓点
let pointSize = CGSize(width: width * 0.3, height: width * 0.3)
(0..<self.text.length).forEach { (index) in
let origin = CGPoint(x: rect.origin.x + CGFloat(index) * width + (width - pointSize.width) / 2, y: rect.origin.y + (rect.height - pointSize.height) / 2)
let pointRect = CGRect(origin: origin, size: pointSize)
context.fillEllipse(in: pointRect)
}
}
//键盘的样式 (UITextInputTraits中的属性)
var keyboardType: UIKeyboardType {
get{
return .numberPad
} set{
}
}
override var canBecomeFirstResponder: Bool {
return true
}
override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
if !isFirstResponder {
becomeFirstResponder()
}
}
}
......@@ -20,6 +20,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
@IBOutlet weak var topCarBtnSelectView: UIView!
var adrArr:Array<String> = ["1","2","3"]
//MARK:--地址信息
var sender:String?
var sendPhone:String?
......@@ -75,7 +76,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
r_province = data?.province
r_district = data?.district
}
listView.reloadData()
getLogPayPrice()
}
......@@ -236,6 +236,8 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
var locBtn = UIButton()
@IBOutlet weak var hListView: UITableView!
var isAlready = true
@IBAction func selectAction(_ sender: UIButton) {
if rightBtn == sender {
......@@ -249,21 +251,17 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}else{
hBtnViewH.constant = 49
}
if carTypesArr.count > 5 {
if isAlready {
setBtnUI(carTypesArr: carTypesArr,view: topCarBtnSelectView)
}else{
setBtnUI(carTypesArr: carTypesArr,view: topCarBtnSelectView)
}
let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线")
topCarBtnSelectView.addSubview(line)
line.snp_makeConstraints { (make) in
make.height.equalTo(1)
make.left.right.bottom.equalTo(0)
let line = UIView()
line.backgroundColor = UIColor(named: "灰色分界线")
topCarBtnSelectView.addSubview(line)
line.snp_makeConstraints { (make) in
make.height.equalTo(1)
make.left.right.bottom.equalTo(0)
}
}
}else{
locBtn.isUserInteractionEnabled = false
rightBtn.isSelected = false
......@@ -300,8 +298,6 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
locBtn.sizeToFit()
locBtn.addTarget(self, action: #selector(locSelect), for: .touchUpInside)
self.view.addSubview(locBtn)
locBtn.snp_makeConstraints({ (make) in
make.right.equalTo(-15)
......@@ -610,7 +606,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
make.right.equalTo(0)
make.height.equalTo(1)
}
let tbv = UITableView()
tbv.tag = 999
tbv.separatorStyle = .none
......@@ -667,7 +663,7 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
return 5
}
}
var adrArr:Array<String> = ["1","2","3","4","2","3","4","2","3","4","2","3","4","2","3","4","2","3","4"]
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
if tableView.tag == 999 {
return adrArr.count - 1
......@@ -740,6 +736,14 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
print(indexPath.section,indexPath.row)
if indexPath.section == 2 {
if indexPath.row == 1 {
let view = XiaDanUserInfoViewController()
self.navigationController?.pushViewController(view, animated: true)
}
if indexPath.row == 2 {
let view = OtherDemandViewController()
self.navigationController?.pushViewController(view, animated: true)
}
//保障
if indexPath.row == 3 {
if glSelectView == nil {
......@@ -932,19 +936,18 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
cell.iconLbl.layer.cornerRadius = 11
cell.lineTopView.isHidden = false
cell.delBtn.isHidden = false
cell.addressLbl.text = adrArr[indexPath.row]
cell.addressDetailLbl.text = adrArr[indexPath.row]
cell.namePhoneLbl.text = adrArr[indexPath.row]
if indexPath.row == 0 {
// cell.addressDetailLbl.text = ""
cell.namePhoneLbl.text = ""
cell.delBtn.isHidden = true
cell.iconLbl.text = "发"
cell.iconLbl.backgroundColor = UIColor.init(named: "蓝色字体颜色")
cell.lineTopView.isHidden = true
}
// else{
// cell.addressDetailLbl.text = "广东省广州市白云区嘉禾望岗白云大道交叉路口东南侧州市白云区嘉禾望岗白云大道交叉路口东南侧(望岗村民委员会西侧约150米))"
// }
if indexPath.row != adrArr.count - 1 && indexPath.row != 0 {
cell.iconLbl.text = ""
......@@ -984,12 +987,19 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
}
@objc func topBtnClick(btn:UIButton){
// topBtnScv.setContentOffset(CGPoint(x: btn.frame.minX, y: 0), animated: true)
for item in lineArr{
if item.tag == btn.tag {
item.isHidden = false
}else{
item.isHidden = true
}
}
for item in btnArr {
if item == btn {
item.isSelected = true
item.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
topBtnLine.frame = CGRect(x: item.frame.origin.x, y: topBtnLine.frame.minY, width: item.bounds.size.width*0.65, height: 2.5)
topBtnLine.center = CGPoint(x: item.center.x, y: topBtnLine.center.y)
}else{
item.isSelected = false
item.setTitleColor(UIColor(named: "提示语字体颜色"), for: .normal)
......@@ -1005,31 +1015,55 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
}
var btnArr:Array<UIButton> = []
var topBtnLine:UIView = UIView()
var lineArr:Array<UIView> = []
var topBtnScv:UIScrollView!
func setBtnUI(carTypesArr:Array<String>,view:UIView){
isAlready = false
btnArr.removeAll()
var num = carTypesArr.count
if num > 5 {
num = 5
for i in 0 ..< num {
let btn = UIButton()
btn.setTitle(carTypesArr[i], for: .normal)
btn.tag = i
view.addSubview(btn)
btn.sizeToFit()
var x:CGFloat = 0
if btnArr.count != 0 {
let button = btnArr[i-1]
x = button.frame.maxX
}
btn.addTarget(self, action: #selector(scrollToPage(sender:)), for: .touchUpInside)
btn.frame = CGRect(x:x, y: 0, width: btn.bounds.size.width + 6, height: 44)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "提示语字体颜色"), for: .normal)
btn.addTarget(self, action: #selector(topBtnClick), for: .touchUpInside)
btnArr.append(btn)
let scv = UIScrollView(frame: view.bounds)
view.addSubview(scv)
topBtnScv = scv
var scvContentWidth = 0
scv.showsHorizontalScrollIndicator = false
scv.tag = 99
for i in 0 ..< carTypesArr.count {
let btn = UIButton()
btn.setTitle(carTypesArr[i], for: .normal)
btn.tag = i
scv.addSubview(btn)
btn.sizeToFit()
var x:CGFloat = 0
if btnArr.count != 0 {
let button = btnArr[i-1]
x = button.frame.maxX
}
btn.addTarget(self, action: #selector(scrollToPage(sender:)), for: .touchUpInside)
btn.frame = CGRect(x:x, y: 0, width: btn.bounds.size.width + 6, height: 44)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "提示语字体颜色"), for: .normal)
btn.addTarget(self, action: #selector(topBtnClick), for: .touchUpInside)
btnArr.append(btn)
scvContentWidth += Int(btn.bounds.size.width)
let topBtnLine = UIView()
topBtnLine.tag = btn.tag
topBtnLine.backgroundColor = UIColor(named: "蓝色字体颜色")
topBtnLine.layer.cornerRadius = 1.25
topBtnLine.layer.masksToBounds = true
topBtnLine.isHidden = true
btn.addSubview(topBtnLine)
topBtnLine.snp.makeConstraints { (make) in
make.left.bottom.right.equalToSuperview()
make.height.equalTo(2.5)
}
lineArr.append(topBtnLine)
}
scv.contentSize = CGSize(width: scvContentWidth, height:1)
if carTypesArr.count > 5 {
let button = UIButton(frame: CGRect(x: fullScreenWidth-44, y: 0, width: 44, height: 44))
button.backgroundColor = UIColor.white
// button.setImage(UIImage(named: ""), for: .normal)
view.addSubview(button)
button.addTarget(self, action: #selector(selectAllCars), for: .touchUpInside)
......@@ -1043,40 +1077,22 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
make.centerY.equalTo(view.snp_centerY)
}
}else{
for i in 0 ..< num {
let btn = UIButton()
btn.setTitle(carTypesArr[i], for: .normal)
btn.tag = i
view.addSubview(btn)
btn.sizeToFit()
var x:CGFloat = 0
if btnArr.count != 0 {
let button = btnArr[i-1]
x = button.frame.maxX
}
btn.addTarget(self, action: #selector(scrollToPage(sender:)), for: .touchUpInside)
btn.frame = CGRect(x:x, y: 0, width: btn.bounds.size.width + 6, height: 44)
btn.titleLabel?.font = UIFont.systemFont(ofSize: 13)
btn.setTitleColor(UIColor(named: "提示语字体颜色"), for: .normal)
btn.addTarget(self, action: #selector(topBtnClick), for: .touchUpInside)
btnArr.append(btn)
scv.snp.updateConstraints { (make) in
make.top.left.bottom.equalToSuperview()
make.right.equalTo(line.snp.left)
}
}
let btn = btnArr.first
btn!.isSelected = true
btn!.setTitleColor(UIColor(named: "蓝色字体颜色"), for: .normal)
topBtnLine.backgroundColor = UIColor(named: "蓝色字体颜色")
topBtnLine.frame = CGRect(x: 0, y: 41.5, width: (btn?.bounds.size.width)!*0.65, height: 2.5)
topBtnLine.center = CGPoint(x: (btn?.center.x)!, y: topBtnLine.center.y)
topBtnLine.layer.cornerRadius = 1.25
topBtnLine.layer.masksToBounds = true
view.addSubview(topBtnLine)
let line = lineArr.first
line!.isHidden = false
}
//MARK: - 选择所有车型
var carTypesArr:Array<String> = ["1","2","3","4","5","6"]
var carTypesArr:Array<String> = ["标题字颜1","标题字颜2","标题字颜3","标题字颜4","标题字5","标题字6"]
var carListView:UIView?
var cBtn:UIButton?
@objc func closeCarList(){
......@@ -1154,12 +1170,33 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
let shopX = CGFloat(col) * w
let shopY = CGFloat(row) * w
let btn = UIButton(frame: CGRect(x: shopX, y: shopY+44, width: w, height: w))
btn.addTarget(self, action: #selector(carSelect(sender:)), for: .touchUpInside)
btn.tag = index
btn.layer.borderColor = UIColor(named: "灰色分界线")?.cgColor
btn.layer.borderWidth = 0.5
btn.setTitle("\(index)", for: .normal)
btn.setTitleColor(UIColor.black, for: .normal)
bg.addSubview(btn)
}
@objc func carSelect(sender:UIButton){
print(sender.tag)
let btn = btnArr[sender.tag]
topBtnClick(btn: btn)
closeCarList()
let idx = IndexPath(row: 0, section: 0)
let cell = hListView.cellForRow(at:idx) as! HLLTopCell
let w = cell.scViewBg.bounds.size.width
cell.scrollView?.setContentOffset(CGPoint(x: sender.tag * Int(w), y: 0), animated: true)
cell.idx = sender.tag
let x = btn.frame.minX
let rect = CGRect(x: Int(x), y: 0, width: Int(w), height: 1)
topBtnScv.scrollRectToVisible(rect, animated: true)
print(rect.minX)
}
//MARK:---预估费用操作
var logPayPriceModel :registerDataModel?
func getLogPayPrice() {
......@@ -1486,14 +1523,14 @@ class XiaYunDanViewController: BaseViewController,UITableViewDelegate,UITableVie
view.removeFromSuperview()
glSelectView = nil
}
//单元格的编辑样式
func tableView(_ tableView: UITableView, editingStyleForRowAt indexPath: IndexPath)
-> UITableViewCell.EditingStyle {
return .none
return .none
}
//去除编辑模式下的头部缩进
func tableView(_ tableView: UITableView, shouldIndentWhileEditingRowAt
......
......@@ -15,7 +15,7 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
@IBOutlet weak var listView: UITableView!
@IBOutlet weak var btmView: UIView!
let btnTitleArr = ["1","2","3"]
let btnTitleArr = ["支付运费","2","3"]
override func viewDidLoad() {
super.viewDidLoad()
navbar.title = "运单详情"
......@@ -75,6 +75,9 @@ class YunDanXiangQingViewController: BaseViewController,UITableViewDelegate,UITa
}
@objc func btnClick(sender:UIButton){
print(sender.tag)
if sender.titleLabel!.text == "支付运费" {
}
let vc = WuLiuGenZongViewController()
self.navigationController?.pushViewController(vc, animated: true)
}
......
......@@ -60,18 +60,18 @@ class ToAndFormSelectViewController: BaseViewController, MAMapViewDelegate, CLLo
IQKeyboardManager.shared.resignFirstResponder()
}
@IBOutlet weak var rightBtn: UIButton!
@IBOutlet weak var leftBtn: UIButton!
@IBAction func listViewRefresh(_ sender: UIButton) {
if sender == leftBtn {
leftBtn.isSelected = true
rightBtn.isSelected = false
lineX.constant = 0
}else{
leftBtn.isSelected = false
rightBtn.isSelected = true
lineX.constant = fullScreenWidth * 0.5
}
// if sender == leftBtn {
// leftBtn.isSelected = true
// rightBtn.isSelected = false
// lineX.constant = 0
// }else{
// leftBtn.isSelected = false
// rightBtn.isSelected = true
// lineX.constant = fullScreenWidth * 0.5
// }
}
@IBOutlet weak var listViewBG: UIView!
......
......@@ -16,12 +16,10 @@
<outlet property="citySelectBtn" destination="ADf-bf-b5w" id="86g-Jd-J9c"/>
<outlet property="closeBtn" destination="T9o-ZR-uVl" id="2u4-UJ-aT3"/>
<outlet property="leftBtn" destination="NcV-XI-uHx" id="gai-yD-umg"/>
<outlet property="lineX" destination="7nr-rY-uEd" id="wyv-M1-EBv"/>
<outlet property="listViewBG" destination="c1E-9c-vVT" id="Y5F-1R-Zyq"/>
<outlet property="nameTF" destination="tlN-2m-Au1" id="DpV-qf-Z56"/>
<outlet property="navBgView" destination="gLT-4M-bfs" id="fjx-Hf-4GS"/>
<outlet property="phoneTF" destination="zpG-8r-dzl" id="nwC-VM-snC"/>
<outlet property="rightBtn" destination="pS2-lL-cUp" id="HGP-qi-64L"/>
<outlet property="selectListV" destination="FkD-95-sVW" id="wNv-R5-d7Z"/>
<outlet property="sureSelectLbl" destination="nZK-ad-fmq" id="5gq-Yd-d6B"/>
<outlet property="toFormTitleLbl" destination="kjg-a9-QU1" id="8Fc-oo-P93"/>
......@@ -225,9 +223,9 @@
<rect key="frame" x="0.0" y="148" width="414" height="748"/>
<subviews>
<button opaque="NO" contentMode="scaleToFill" selected="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="NcV-XI-uHx">
<rect key="frame" x="0.0" y="0.0" width="206.5" height="51.5"/>
<rect key="frame" x="0.0" y="0.0" width="414" height="51.5"/>
<constraints>
<constraint firstAttribute="height" constant="51.5" id="WFr-ur-o45"/>
<constraint firstAttribute="height" constant="51.5" id="3FM-pF-Ev2"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
......@@ -241,31 +239,6 @@
<action selector="listViewRefresh:" destination="-1" eventType="touchUpInside" id="6ao-NZ-zbY"/>
</connections>
</button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="pS2-lL-cUp">
<rect key="frame" x="207.5" y="0.0" width="206.5" height="51.5"/>
<constraints>
<constraint firstAttribute="height" constant="51.5" id="2Oq-8V-SXe"/>
</constraints>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="tintColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<state key="normal" title="常用地址">
<color key="titleColor" name="多选按钮字体颜色"/>
</state>
<state key="selected" title="常用地址">
<color key="titleColor" name="蓝色字体颜色"/>
</state>
<connections>
<action selector="listViewRefresh:" destination="-1" eventType="touchUpInside" id="8BA-uO-hre"/>
</connections>
</button>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="H2r-af-vS6">
<rect key="frame" x="206.5" y="7.5" width="1" height="36.5"/>
<color key="backgroundColor" name="灰色分界线"/>
<constraints>
<constraint firstAttribute="width" constant="1" id="YCA-he-MkA"/>
<constraint firstAttribute="height" constant="36.5" id="oDp-nT-sHR"/>
</constraints>
</view>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="0Ha-lY-Z5m">
<rect key="frame" x="0.0" y="51.5" width="414" height="1"/>
<color key="backgroundColor" name="灰色分界线"/>
......@@ -281,7 +254,7 @@
</constraints>
</imageView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="定位当前地址" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="whf-6g-CGo">
<rect key="frame" x="37" y="70" width="80" height="16"/>
<rect key="frame" x="37" y="69.5" width="80" height="16.5"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" name="标题字颜色"/>
<nil key="highlightedColor"/>
......@@ -307,49 +280,30 @@
<outlet property="delegate" destination="-1" id="Abz-vu-2hp"/>
</connections>
</tableView>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="maR-I9-Ohr">
<rect key="frame" x="0.0" y="50" width="206.5" height="2.5"/>
<color key="backgroundColor" name="蓝色字体颜色"/>
<constraints>
<constraint firstAttribute="height" constant="2.5" id="wkY-iJ-uxN"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
<real key="value" value="1.25"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
</subviews>
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
<constraints>
<constraint firstItem="pS2-lL-cUp" firstAttribute="top" secondItem="c1E-9c-vVT" secondAttribute="top" id="5BL-o1-Fxg"/>
<constraint firstItem="0Ha-lY-Z5m" firstAttribute="top" secondItem="NcV-XI-uHx" secondAttribute="bottom" id="2nu-dJ-y63"/>
<constraint firstItem="FkD-95-sVW" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="5BV-xv-6A3"/>
<constraint firstAttribute="trailing" secondItem="NcV-XI-uHx" secondAttribute="trailing" id="5VT-22-5AL"/>
<constraint firstItem="FkD-95-sVW" firstAttribute="top" secondItem="7b1-Dd-JY1" secondAttribute="bottom" id="6vs-qH-hJx"/>
<constraint firstItem="maR-I9-Ohr" firstAttribute="width" secondItem="NcV-XI-uHx" secondAttribute="width" id="7Hj-T9-Ub1"/>
<constraint firstItem="H2r-af-vS6" firstAttribute="centerX" secondItem="c1E-9c-vVT" secondAttribute="centerX" id="7f6-Bo-LWG"/>
<constraint firstItem="maR-I9-Ohr" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="7nr-rY-uEd"/>
<constraint firstItem="qwS-jQ-IIf" firstAttribute="top" secondItem="7b1-Dd-JY1" secondAttribute="bottom" id="EZn-ty-rFI"/>
<constraint firstItem="NcV-XI-uHx" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="G3b-qJ-edd"/>
<constraint firstItem="DCc-3H-FXA" firstAttribute="top" secondItem="0Ha-lY-Z5m" secondAttribute="bottom" constant="18" id="J19-GU-2qe"/>
<constraint firstAttribute="trailing" secondItem="qwS-jQ-IIf" secondAttribute="trailing" id="JRb-Nt-Cku"/>
<constraint firstItem="DCc-3H-FXA" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" constant="15" id="MCw-hb-LLg"/>
<constraint firstAttribute="trailing" secondItem="pS2-lL-cUp" secondAttribute="trailing" id="NYN-7W-6xL"/>
<constraint firstItem="H2r-af-vS6" firstAttribute="leading" secondItem="NcV-XI-uHx" secondAttribute="trailing" id="NsZ-He-8yM"/>
<constraint firstItem="NcV-XI-uHx" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="OJc-Wu-Iyt"/>
<constraint firstItem="qwS-jQ-IIf" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" constant="15" id="Pmh-ZZ-L8z"/>
<constraint firstItem="NcV-XI-uHx" firstAttribute="top" secondItem="c1E-9c-vVT" secondAttribute="top" id="TGz-FC-jnc"/>
<constraint firstItem="qwS-jQ-IIf" firstAttribute="top" secondItem="whf-6g-CGo" secondAttribute="bottom" constant="15.5" id="UlX-s6-M7Q"/>
<constraint firstItem="whf-6g-CGo" firstAttribute="centerY" secondItem="DCc-3H-FXA" secondAttribute="centerY" id="Xfv-A8-A4u"/>
<constraint firstItem="7b1-Dd-JY1" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="Zy6-7W-IKm"/>
<constraint firstItem="whf-6g-CGo" firstAttribute="leading" secondItem="DCc-3H-FXA" secondAttribute="trailing" constant="10" id="c07-MW-tgw"/>
<constraint firstAttribute="trailing" secondItem="0Ha-lY-Z5m" secondAttribute="trailing" id="c9z-Tw-2yO"/>
<constraint firstItem="pS2-lL-cUp" firstAttribute="leading" secondItem="H2r-af-vS6" secondAttribute="trailing" id="cVB-PT-Uwt"/>
<constraint firstAttribute="trailing" secondItem="FkD-95-sVW" secondAttribute="trailing" id="eFd-Tv-CIv"/>
<constraint firstItem="7b1-Dd-JY1" firstAttribute="top" secondItem="maR-I9-Ohr" secondAttribute="bottom" id="eVi-CT-HfP"/>
<constraint firstItem="0Ha-lY-Z5m" firstAttribute="top" secondItem="NcV-XI-uHx" secondAttribute="bottom" id="kiJ-5L-OXQ"/>
<constraint firstItem="qwS-jQ-IIf" firstAttribute="top" secondItem="0Ha-lY-Z5m" secondAttribute="bottom" constant="49" id="lOX-5M-Ru5"/>
<constraint firstItem="0Ha-lY-Z5m" firstAttribute="leading" secondItem="c1E-9c-vVT" secondAttribute="leading" id="lqg-ah-mQ6"/>
<constraint firstItem="NcV-XI-uHx" firstAttribute="top" secondItem="c1E-9c-vVT" secondAttribute="top" id="rRB-EU-3nc"/>
<constraint firstItem="7b1-Dd-JY1" firstAttribute="top" secondItem="0Ha-lY-Z5m" secondAttribute="bottom" id="wMf-gc-4TG"/>
<constraint firstAttribute="bottom" secondItem="FkD-95-sVW" secondAttribute="bottom" id="wmq-WJ-9rk"/>
<constraint firstItem="H2r-af-vS6" firstAttribute="top" secondItem="c1E-9c-vVT" secondAttribute="top" constant="7.5" id="zaZ-mU-GOc"/>
<constraint firstAttribute="trailing" secondItem="7b1-Dd-JY1" secondAttribute="trailing" id="zc6-2p-wci"/>
</constraints>
</view>
......
......@@ -32,8 +32,6 @@ UITableViewDataSource,UIGestureRecognizerDelegate {
self.tableView!.setEditing(true, animated:true)
self.tableView!.separatorStyle = .none
}
//在本例中,只有一个分区
......
......@@ -40,10 +40,8 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
if scrollView.contentOffset.x/scViewBg.bounds.size.width <= 0 {
leftBtn.isHidden = true
}
var num = datas.count-1
if num > 4 {
num = 4
}
let num = datas.count - 1
if scrollView.contentOffset.x/scViewBg.bounds.size.width >= CGFloat(num) {
rightBtn.isHidden = true
}
......@@ -78,10 +76,7 @@ class HLLTopCell: UITableViewCell,UIScrollViewDelegate {
scrollView?.showsHorizontalScrollIndicator = false
scrollView?.delegate = self
var num = datas.count - 1
if num > 5 {
num = 5
}
var num = datas.count
scrollView?.contentSize = CGSize(width: (scViewBg.bounds.size.width) * CGFloat(num), height: (scViewBg.bounds.size.height))
for i in 0 ..< num{
......
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