Commit 56579487 authored by 刘俊宏's avatar 刘俊宏

添加订单列表筛选视图功能

parent 7d0e3df1
...@@ -3,27 +3,4 @@ ...@@ -3,27 +3,4 @@
uuid = "5B8F44F7-39A9-41EF-84D0-455B68FF56A8" uuid = "5B8F44F7-39A9-41EF-84D0-455B68FF56A8"
type = "0" type = "0"
version = "2.0"> version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
<BreakpointContent
uuid = "47CF42B7-E5E4-4914-BF79-0C1440336BDB"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent
uuid = "DA0714E8-DD5C-48E8-93AF-CB4E86B966F9"
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
breakpointStackSelectionBehavior = "1"
scope = "1"
stopOnStyle = "0">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket> </Bucket>
{
"images" : [
{
"filename" : "shaixuan.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "shaixuan@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "shaixuan@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
...@@ -7,15 +7,30 @@ ...@@ -7,15 +7,30 @@
// //
import Foundation import Foundation
class OrderSelectMoreView: UIView { import SwiftDate
var contentView:UIView!
protocol OrderSelectMoreViewDelegate {
func sureAction(selectData:Any)
func colseAction()
}
class OrderSelectMoreView: UIView,TitleAndSelCalendarViewDelegate ,TimeSelectViewDelgate{
var contentView:UIView!
var delegate:OrderSelectMoreViewDelegate?
@IBOutlet weak var contentWidht: NSLayoutConstraint! @IBOutlet weak var contentWidht: NSLayoutConstraint!
@IBOutlet weak var contentHeight: NSLayoutConstraint! @IBOutlet weak var contentHeight: NSLayoutConstraint!
@IBOutlet weak var moreBgView: UIView! @IBOutlet weak var moreBgView: UIView!
@IBAction func colseByBlackTap(_ sender: UITapGestureRecognizer) { @IBAction func colseByBlackTap(_ sender: UITapGestureRecognizer) {
self.removeFromSuperview() self.removeFromSuperview()
self.delegate?.colseAction()
}
@IBAction func sure(_ sender: UIButton) {
self.removeFromSuperview()
self.delegate?.sureAction(selectData: "")
}
@IBAction func reset(_ sender: Any) {
} }
//初始化时将xib中的view添加进来 //初始化时将xib中的view添加进来
...@@ -49,16 +64,19 @@ class OrderSelectMoreView: UIView { ...@@ -49,16 +64,19 @@ class OrderSelectMoreView: UIView {
let view = nib.instantiate(withOwner: self, options: nil).first as! UIView let view = nib.instantiate(withOwner: self, options: nil).first as! UIView
return view return view
} }
let line1 = UIView()
let timeTilelV = TitleAndSelCalendarView()
func setUI() { func setUI() {
let timeTilelV = TitleAndSelCalendarView() timeTilelV.delegate = self
moreBgView.addSubview(timeTilelV) moreBgView.addSubview(timeTilelV)
timeTilelV.snp.makeConstraints { (make) in timeTilelV.snp.makeConstraints { (make) in
make.left.top.equalTo(15*glscale) make.left.top.equalTo(15*glscale)
make.right.equalTo(-135*glscale) make.right.equalTo(-135*glscale)
make.height.equalTo(60*glscale) make.height.equalTo(60*glscale)
} }
//分界线1 //分界线1
let line1 = UIView()
line1.backgroundColor = UIColor.init(named: "灰色分界线") line1.backgroundColor = UIColor.init(named: "灰色分界线")
moreBgView.addSubview(line1) moreBgView.addSubview(line1)
line1.snp.makeConstraints { (make) in line1.snp.makeConstraints { (make) in
...@@ -161,6 +179,33 @@ class OrderSelectMoreView: UIView { ...@@ -161,6 +179,33 @@ class OrderSelectMoreView: UIView {
sender.backgroundColor = UIColor.init(named: "多选按钮背景颜色") sender.backgroundColor = UIColor.init(named: "多选按钮背景颜色")
} }
} }
let calendarV = TimeSelectView(frame: CGRect(x: 0, y: 85*glscale, width: fullScreenWidth, height: 235*glscale))
//MARK:--展示日历选择器
func isShowCalendarV(isShow: Bool) {
if isShow {
contentHeight.constant = 400*glscale + 235*glscale
calendarV.moreSelection = true
moreBgView.addSubview(calendarV)
calendarV.delegate = self
line1.snp.remakeConstraints { (make) in
make.left.right.equalTo(0)
make.height.equalTo(1)
make.top.equalTo(calendarV.snp_bottom)
}
}else{
calendarV.removeFromSuperview()
contentHeight.constant = 400*glscale
line1.snp.remakeConstraints { (make) in
make.left.right.equalTo(0)
make.height.equalTo(1)
make.top.equalTo(timeTilelV.snp_bottom).offset(15*glscale)
}
}
}
//MARK:--日历代理
func selectMoreDate(beginDate: Date, endginDate: Date) {
timeTilelV.timeLbl.text = beginDate.toFormat("yyyy.MM.dd") + "," + endginDate.toFormat("yyyy.MM.dd")
}
} }
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
<state key="normal" title="重置"> <state key="normal" title="重置">
<color key="titleColor" name="灰色字体颜色"/> <color key="titleColor" name="灰色字体颜色"/>
</state> </state>
<connections>
<action selector="reset:" destination="-1" eventType="touchUpInside" id="6wq-Zb-6wr"/>
</connections>
</button> </button>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sTi-CD-uRH"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sTi-CD-uRH">
<rect key="frame" x="188" y="400" width="187" height="50"/> <rect key="frame" x="188" y="400" width="187" height="50"/>
...@@ -57,6 +60,9 @@ ...@@ -57,6 +60,9 @@
<state key="normal" title="确定"> <state key="normal" title="确定">
<color key="titleColor" name="蓝色字体颜色"/> <color key="titleColor" name="蓝色字体颜色"/>
</state> </state>
<connections>
<action selector="sure:" destination="-1" eventType="touchUpInside" id="Ad9-CJ-Cfr"/>
</connections>
</button> </button>
<scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zOf-Po-PY2"> <scrollView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="zOf-Po-PY2">
<rect key="frame" x="0.0" y="5" width="375" height="394"/> <rect key="frame" x="0.0" y="5" width="375" height="394"/>
...@@ -148,10 +154,10 @@ ...@@ -148,10 +154,10 @@
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
<namedColor name="灰色字体颜色"> <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>
<namedColor name="蓝色字体颜色"> <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> </namedColor>
</resources> </resources>
</document> </document>
...@@ -7,13 +7,19 @@ ...@@ -7,13 +7,19 @@
// //
import Foundation import Foundation
protocol TitleAndSelCalendarViewDelegate {
func isShowCalendarV(isShow:Bool)
}
class TitleAndSelCalendarView: UIView { class TitleAndSelCalendarView: UIView {
var contentView:UIView! var contentView:UIView!
var delegate:TitleAndSelCalendarViewDelegate?
var isSelectV :Bool = false
@IBOutlet weak var timeLbl: UILabel! @IBOutlet weak var timeLbl: UILabel!
@IBAction func btnAction(_ sender: UIButton) { @IBAction func btnAction(_ sender: UIButton) {
print("选择时间范围--") print("选择时间范围--")
isSelectV = !isSelectV
self.delegate?.isShowCalendarV(isShow: isSelectV)
} }
//初始化时将xib中的view添加进来 //初始化时将xib中的view添加进来
override init(frame: CGRect) { override init(frame: CGRect) {
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<objects> <objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TitleAndSelCalendarView"> <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="TitleAndSelCalendarView">
<connections> <connections>
<outlet property="timeLbl" destination="AL5-PY-wu7" id="KF9-eb-w55"/> <outlet property="timeLbl" destination="AL5-PY-wu7" id="hhy-zI-9oC"/>
</connections> </connections>
</placeholder> </placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
...@@ -65,10 +65,10 @@ ...@@ -65,10 +65,10 @@
</objects> </objects>
<resources> <resources>
<namedColor name="标题字颜色"> <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>
<namedColor name="灰色字体颜色"> <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>
</resources> </resources>
</document> </document>
...@@ -8,7 +8,13 @@ ...@@ -8,7 +8,13 @@
import UIKit import UIKit
protocol TimeSelectViewDelgate {
func selectMoreDate(beginDate:Date,endginDate:Date)
}
class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate { class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
var delegate:TimeSelectViewDelgate?
fileprivate weak var calendarC: FSCalendar! fileprivate weak var calendarC: FSCalendar!
var moreSelection:Bool = false { var moreSelection:Bool = false {
...@@ -81,7 +87,17 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate { ...@@ -81,7 +87,17 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
var BeginDate: Date! var BeginDate: Date!
var EndDate: Date! var EndDate: Date!
var SelectAction: Bool = false var SelectAction: Bool = false
func clearTheSelect(){
let selectArr = calendarC.selectedDates
for select in selectArr {
calendarC.deselect(select)
}
EndDate = nil
BeginDate = nil
SelectAction = false
self.configureVisibleCells()
}
//选中某一天进行相关操作 //选中某一天进行相关操作
func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) { func calendar(_ calendar: FSCalendar, didSelect date: Date, at monthPosition: FSCalendarMonthPosition) {
let dateA = self.gregorian.date(byAdding: .day, value: 1, to: date)! let dateA = self.gregorian.date(byAdding: .day, value: 1, to: date)!
...@@ -98,8 +114,7 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate { ...@@ -98,8 +114,7 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
SelectAction = true SelectAction = true
EndDate = nil EndDate = nil
let previousDate = self.gregorian.date(byAdding: .day, value: 1, to: BeginDate)!
print("选中开始时间\(previousDate)")
}else{ }else{
let number = numberOfDaysWithFromDate(fromDate: BeginDate, toDate: date)! let number = numberOfDaysWithFromDate(fromDate: BeginDate, toDate: date)!
...@@ -121,10 +136,13 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate { ...@@ -121,10 +136,13 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
let dateA = date.addingTimeInterval(TimeInterval(-i*60*60*24)) let dateA = date.addingTimeInterval(TimeInterval(-i*60*60*24))
calendarC.select(dateA) calendarC.select(dateA)
} }
let previousDate = self.gregorian.date(byAdding: .day, value: 1, to: BeginDate)!
print("选中开始时间\(previousDate)")
let nextDate = self.gregorian.date(byAdding: .day, value: 1, to: EndDate)! let nextDate = self.gregorian.date(byAdding: .day, value: 1, to: EndDate)!
print("选中结束时间\(nextDate)") print("选中结束时间\(nextDate)")
self.delegate?.selectMoreDate(beginDate: previousDate, endginDate: nextDate)
} }
} }
} }
...@@ -147,6 +165,9 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate { ...@@ -147,6 +165,9 @@ class TimeSelectView: UIView, FSCalendarDataSource, FSCalendarDelegate {
} }
self.configureVisibleCells() self.configureVisibleCells()
} }
func maximumDate(for calendar: FSCalendar) -> Date {
return Date()
}
// func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool { // func calendar(_ calendar: FSCalendar, shouldSelect date: Date, at monthPosition: FSCalendarMonthPosition) -> Bool {
// return monthPosition == .current // return monthPosition == .current
// } // }
......
...@@ -80,7 +80,10 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -80,7 +80,10 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
//MARK:--新增代理 //MARK:--新增代理
@IBAction func addNewWarehose(_ sender: UIButton) { @IBAction func addNewWarehose(_ sender: UIButton) {
print("点击新增--") print("点击新增--")
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
} }
var tableV :UITableView! var tableV :UITableView!
......
...@@ -18,6 +18,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc ...@@ -18,6 +18,7 @@ class OrderListVC: BaseViewController, UITableViewDelegate, UITableViewDataSourc
} }
var dataArr:Array<Any> = [] { var dataArr:Array<Any> = [] {
didSet{ didSet{
tableV.reloadData() tableV.reloadData()
tableV.performBatchUpdates({ tableV.performBatchUpdates({
UIView.animate(views: self.tableV!.visibleCells, UIView.animate(views: self.tableV!.visibleCells,
......
...@@ -9,15 +9,15 @@ ...@@ -9,15 +9,15 @@
import UIKit import UIKit
import Parchment import Parchment
class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBarViewDelegate, PagingViewControllerDelegate{ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBarViewDelegate, PagingViewControllerDelegate, OrderSelectMoreViewDelegate{
fileprivate let cities = [ fileprivate let cities = [
"全部", "全部",
"待确认", "待确认",
"待付款", "待付款",
"待发货", "待发货",
"已发货", "已发货",
"退款/货", "退款/货",
"已取消" "已取消"
] ]
let viewControllers = [ let viewControllers = [
OrderListVC(title: "全部"), OrderListVC(title: "全部"),
...@@ -28,7 +28,7 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa ...@@ -28,7 +28,7 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
OrderListVC(title: "退款/货"), OrderListVC(title: "退款/货"),
OrderListVC(title: "已取消") OrderListVC(title: "已取消")
] ]
var searchV : SearchBarView? = nil
@IBOutlet weak var contentView: UIView! @IBOutlet weak var contentView: UIView!
@IBOutlet weak var searchBgView: UIView! @IBOutlet weak var searchBgView: UIView!
override func viewDidLoad() { override func viewDidLoad() {
...@@ -43,7 +43,7 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa ...@@ -43,7 +43,7 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
make.centerY.equalToSuperview() make.centerY.equalToSuperview()
make.height.equalTo(35) make.height.equalTo(35)
} }
searchV = searchBr
searchBr.placeholderStr = "请输入订单编号/客户名称" searchBr.placeholderStr = "请输入订单编号/客户名称"
searchBr.cornerRadius = 35/2.0 searchBr.cornerRadius = 35/2.0
searchBr.delegate = self searchBr.delegate = self
...@@ -79,13 +79,63 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa ...@@ -79,13 +79,63 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
func clearSearchAction() { func clearSearchAction() {
} }
func searchBarTextDidEndEditing(_ searchBar: UISearchBar) {
print("编辑即将结束了--")
removeBlackBtnView()
}
//MARK:--筛选 //MARK:--筛选
var selectV : OrderSelectMoreView! = nil
@IBAction func SelectOtherAction(_ sender: UIButton) { @IBAction func SelectOtherAction(_ sender: UIButton) {
print("筛选") print("筛选")
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
if selectV == nil {
selectV = OrderSelectMoreView()
selectV.delegate = self
self.view.window?.addSubview(selectV)
selectV.snp.makeConstraints { (make) in
make.left.right.bottom.equalToSuperview()
make.top.equalTo(contentView.snp_top)
}
}else{
selectV.removeFromSuperview()
selectV = nil
}
} }
//MARK: -- 筛选代理
func sureAction(selectData: Any) {
selectV = nil
}
func colseAction() {
selectV = nil
}
//MAKR:--调起搜索后添加个蒙版本
var blackBtnView:UIButton! = nil
func searchBarShouldBeginEditing(_ searchBar: UISearchBar) -> Bool {
print("调起搜索后添加个蒙版本")
blackBtnView = UIButton ()
blackBtnView.backgroundColor = UIColor.init(named: "提示视图背景色")
contentView.addSubview(blackBtnView)
blackBtnView.snp.makeConstraints { (make) in
make.left.right.top.bottom.equalToSuperview()
}
blackBtnView.addTarget(self, action: #selector(removeBlackBtnView), for: .touchUpInside)
if selectV != nil {
selectV.removeFromSuperview()
selectV = nil
}
return true
}
@objc func removeBlackBtnView(){
if blackBtnView != nil {
blackBtnView.removeFromSuperview()
searchV!.resignFirstResponder()
}
}
//MARK:---滚动选择
var selectIndex = 0 var selectIndex = 0
func pagingViewController(_ pagingViewController: PagingViewController, didScrollToItem pagingItem: PagingItem, startingViewController: UIViewController?, destinationViewController: UIViewController, transitionSuccessful: Bool) { func pagingViewController(_ pagingViewController: PagingViewController, didScrollToItem pagingItem: PagingItem, startingViewController: UIViewController?, destinationViewController: UIViewController, transitionSuccessful: Bool) {
guard let item = pagingItem as? PagingIndexItem else { return} guard let item = pagingItem as? PagingIndexItem else { return}
...@@ -96,46 +146,46 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa ...@@ -96,46 +146,46 @@ class OrderListViewController: BaseViewController ,UISearchBarDelegate, SearchBa
vc.dataArr = ["","","",""] vc.dataArr = ["","","",""]
} }
} }
} }
extension OrderListViewController: PagingViewControllerDataSource { extension OrderListViewController: PagingViewControllerDataSource {
func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem { func pagingViewController(_: PagingViewController, pagingItemAt index: Int) -> PagingItem {
return PagingIndexItem(index: index, title: cities[index]) return PagingIndexItem(index: index, title: cities[index])
} }
func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -> UIViewController { func pagingViewController(_: PagingViewController, viewControllerAt index: Int) -> UIViewController {
return viewControllers[index] return viewControllers[index]
} }
func numberOfViewControllers(in pagingViewController: PagingViewController) -> Int { func numberOfViewControllers(in pagingViewController: PagingViewController) -> Int {
return cities.count return cities.count
} }
} }
extension OrderListViewController: PagingViewControllerSizeDelegate { extension OrderListViewController: PagingViewControllerSizeDelegate {
func pagingViewController(_ pagingViewController: PagingViewController, widthForPagingItem pagingItem: PagingItem, isSelected: Bool) -> CGFloat {
guard let item = pagingItem as? PagingIndexItem else { return 0 }
let insets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
let size = CGSize(width: CGFloat.greatestFiniteMagnitude, height: pagingViewController.options.menuItemSize.height)
let attributes = [NSAttributedString.Key.font: pagingViewController.options.font]
let rect = item.title.boundingRect(with: size,
options: .usesLineFragmentOrigin,
attributes: attributes,
context: nil)
let width = ceil(rect.width) + insets.left + insets.right func pagingViewController(_ pagingViewController: PagingViewController, widthForPagingItem pagingItem: PagingItem, isSelected: Bool) -> CGFloat {
guard let item = pagingItem as? PagingIndexItem else { return 0 }
if isSelected {
return width * 1.5 let insets = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
} else { let size = CGSize(width: CGFloat.greatestFiniteMagnitude, height: pagingViewController.options.menuItemSize.height)
return width let attributes = [NSAttributedString.Key.font: pagingViewController.options.font]
let rect = item.title.boundingRect(with: size,
options: .usesLineFragmentOrigin,
attributes: attributes,
context: nil)
let width = ceil(rect.width) + insets.left + insets.right
if isSelected {
return width * 1.5
} else {
return width
}
} }
}
} }
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<constraint firstAttribute="height" constant="45" id="yth-ne-PfG"/> <constraint firstAttribute="height" constant="45" id="yth-ne-PfG"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oFn-kE-fo4"> <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="oFn-kE-fo4">
<rect key="frame" x="320" y="7.5" width="55" height="30"/> <rect key="frame" x="320" y="11.5" width="55" height="22"/>
<state key="normal" title="筛选"/> <state key="normal" image="shaixuan"/>
<connections> <connections>
<action selector="SelectOtherAction:" destination="-1" eventType="touchUpInside" id="Q40-3H-hF7"/> <action selector="SelectOtherAction:" destination="-1" eventType="touchUpInside" id="Q40-3H-hF7"/>
</connections> </connections>
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="shaixuan" width="17" height="15"/>
<namedColor name="灰色分界线"> <namedColor name="灰色分界线">
<color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.92941176470588238" green="0.92941176470588238" blue="0.92941176470588238" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</namedColor> </namedColor>
......
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