Commit 299de975 authored by lujunye's avatar lujunye

补充图片

parent b8d42b88
...@@ -12,6 +12,7 @@ import LGButton ...@@ -12,6 +12,7 @@ import LGButton
protocol GLTimeSelectViewDelegate { protocol GLTimeSelectViewDelegate {
func GLTimeSelectViewSelectFinish(date:String) func GLTimeSelectViewSelectFinish(date:String)
func GLTimeSelectViewClose()
} }
class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource { class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
...@@ -90,6 +91,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -90,6 +91,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
self.removeFromSuperview() self.removeFromSuperview()
} }
@IBAction func close_action(_ sender: Any) { @IBAction func close_action(_ sender: Any) {
delegate?.GLTimeSelectViewClose()
self.removeFromSuperview() self.removeFromSuperview()
} }
func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int { func pickerView(_ pickerView: UIPickerView, numberOfRowsInComponent component: Int) -> Int {
...@@ -100,7 +102,9 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -100,7 +102,9 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
} }
return days.count return days.count
} }
func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? { func pickerView(_ pickerView: UIPickerView, titleForRow row: Int, forComponent component: Int) -> String? {
if component == 0 { if component == 0 {
return years[row] return years[row]
}else if component == 1 { }else if component == 1 {
...@@ -108,6 +112,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -108,6 +112,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
} }
return days[row]+"日" return days[row]+"日"
} }
func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) { func pickerView(_ pickerView: UIPickerView, didSelectRow row: Int, inComponent component: Int) {
let arr = getDate() let arr = getDate()
switch component { switch component {
...@@ -249,6 +254,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource { ...@@ -249,6 +254,7 @@ class GLTimeSelectView: UIView, UIPickerViewDelegate, UIPickerViewDataSource {
func setUI(){ func setUI(){
time_picker.delegate = self time_picker.delegate = self
time_picker.dataSource = self time_picker.dataSource = self
// time_picker.showsSelectionIndicator = true
let arr = getDate() let arr = getDate()
var strTime = 2003 var strTime = 2003
......
...@@ -58,7 +58,6 @@ class DIYCalendarCell: FSCalendarCell { ...@@ -58,7 +58,6 @@ class DIYCalendarCell: FSCalendarCell {
if selectionType == .middle { if selectionType == .middle {
print("middle--middle") print("middle--middle")
self.titleLabel.textColor = UIColor.init(named: "蓝色字体颜色") self.titleLabel.textColor = UIColor.init(named: "蓝色字体颜色")
let color = UIColor.white let color = UIColor.white
self.selectionLayer.fillColor = color.cgColor self.selectionLayer.fillColor = color.cgColor
self.selectionLayer.path = UIBezierPath(rect: self.selectionLayer.bounds).cgPath self.selectionLayer.path = UIBezierPath(rect: self.selectionLayer.bounds).cgPath
......
...@@ -56,9 +56,10 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -56,9 +56,10 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
@IBOutlet weak var top_view_h: NSLayoutConstraint! @IBOutlet weak var top_view_h: NSLayoutConstraint!
@IBOutlet weak var top_view: UIView! @IBOutlet weak var top_view: UIView!
func GLTimeSelectViewClose(){arrow_img.image = UIImage(named: "down_black")}
func GLTimeSelectViewSelectFinish(date: String) { func GLTimeSelectViewSelectFinish(date: String) {
arrow_img.image = UIImage(named: "down_black")
if date.count == 4 { if date.count == 4 {
date_lbl.text = date + "年" date_lbl.text = date + "年"
}else if date.count > 4 && date.count <= 7 { }else if date.count > 4 && date.count <= 7 {
...@@ -75,6 +76,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -75,6 +76,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
} }
@IBAction func date_select_action(_ sender: Any) { @IBAction func date_select_action(_ sender: Any) {
arrow_img.image = UIImage(named: "up_black")
let vc = GLTimeSelectView(frame: self.view.bounds) let vc = GLTimeSelectView(frame: self.view.bounds)
vc.delegate = self vc.delegate = self
vc.dateStr = strNowTime vc.dateStr = strNowTime
...@@ -121,7 +123,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi ...@@ -121,7 +123,7 @@ class FXSY_ViewController: BaseViewController,GLTimeSelectViewDelegate,UITableVi
@IBAction func type_select(_ sender: Any) { @IBAction func type_select(_ sender: Any) {
if glSelectView == nil { if glSelectView == nil {
let view = GLAlertSelectView(frame: self.view.bounds) let view = GLAlertSelectView(frame: self.view.bounds)
view.titleLbl.text = "请选择国家" view.titleLbl.text = "请选择收支类型"
view.delegate = self view.delegate = self
view.dataArr = ["收入","支出"] view.dataArr = ["收入","支出"]
view.is_center_select = true view.is_center_select = true
......
...@@ -144,7 +144,7 @@ ...@@ -144,7 +144,7 @@
<nil key="textColor"/> <nil key="textColor"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="offline_zhankai_2.png" translatesAutoresizingMaskIntoConstraints="NO" id="LRJ-fs-pAL"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="down_black" translatesAutoresizingMaskIntoConstraints="NO" id="LRJ-fs-pAL">
<rect key="frame" x="64" y="29" width="12" height="6"/> <rect key="frame" x="64" y="29" width="12" height="6"/>
<constraints> <constraints>
<constraint firstAttribute="height" constant="6" id="6h3-zg-g2Y"/> <constraint firstAttribute="height" constant="6" id="6h3-zg-g2Y"/>
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
</view> </view>
</objects> </objects>
<resources> <resources>
<image name="offline_zhankai_2.png" width="24" height="24"/> <image name="down_black" width="11.5" height="6"/>
<namedColor name="多选按钮字体颜色"> <namedColor name="多选按钮字体颜色">
<color red="0.41176470588235292" green="0.41176470588235292" blue="0.41176470588235292" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> <color red="0.41176470588235292" green="0.41176470588235292" blue="0.41176470588235292" 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