Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
GeliBusinessPlatform
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ljy
GeliBusinessPlatform
Commits
6429fc57
Commit
6429fc57
authored
Dec 30, 2020
by
lujunye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
日历选择添加背景色
parent
299de975
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
16 deletions
+78
-16
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
...erdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
+0
-0
GeliBusinessPlatform/Assets.xcassets/背景色/#E0EEFF.colorset/Contents.json
...atform/Assets.xcassets/背景色/#E0EEFF.colorset/Contents.json
+38
-0
GeliBusinessPlatform/View/TimeSelectView/DIYCalendarCell.swift
...usinessPlatform/View/TimeSelectView/DIYCalendarCell.swift
+40
-16
No files found.
GeliBusinessPlatform.xcworkspace/xcuserdata/junyelu.xcuserdatad/UserInterfaceState.xcuserstate
View file @
6429fc57
No preview for this file type
GeliBusinessPlatform/Assets.xcassets/背景色/#E0EEFF.colorset/Contents.json
0 → 100644
View file @
6429fc57
{
"colors"
:
[
{
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"1.000"
,
"green"
:
"0.933"
,
"red"
:
"0.878"
}
},
"idiom"
:
"universal"
},
{
"appearances"
:
[
{
"appearance"
:
"luminosity"
,
"value"
:
"dark"
}
],
"color"
:
{
"color-space"
:
"srgb"
,
"components"
:
{
"alpha"
:
"1.000"
,
"blue"
:
"1.000"
,
"green"
:
"0.933"
,
"red"
:
"0.878"
}
},
"idiom"
:
"universal"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
GeliBusinessPlatform/View/TimeSelectView/DIYCalendarCell.swift
View file @
6429fc57
...
...
@@ -23,6 +23,8 @@ class DIYCalendarCell: FSCalendarCell {
weak
var
selectionLayer
:
CAShapeLayer
!
weak
var
selectionLayer2
:
CAShapeLayer
!
var
selectionType
:
SelectionType
=
.
none
{
didSet
{
setNeedsLayout
()
...
...
@@ -36,8 +38,8 @@ class DIYCalendarCell: FSCalendarCell {
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
let
color
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
// //选中layer
let
selectionLayer
=
CAShapeLayer
()
selectionLayer
.
fillColor
=
color
?
.
cgColor
...
...
@@ -45,49 +47,71 @@ class DIYCalendarCell: FSCalendarCell {
self
.
contentView
.
layer
.
insertSublayer
(
selectionLayer
,
below
:
self
.
titleLabel
!.
layer
)
self
.
selectionLayer
=
selectionLayer
self
.
shapeLayer
.
isHidden
=
true
//下面代码为添加选中日期背景色
let
selectionLayer2
=
CAShapeLayer
()
selectionLayer2
.
fillColor
=
color
?
.
cgColor
selectionLayer2
.
actions
=
[
"hidden"
:
NSNull
()]
self
.
contentView
.
layer
.
insertSublayer
(
selectionLayer2
,
below
:
selectionLayer
)
self
.
selectionLayer2
=
selectionLayer2
}
override
func
layoutSubviews
()
{
super
.
layoutSubviews
()
self
.
selectionLayer
.
frame
=
self
.
contentView
.
bounds
let
color
=
UIColor
.
white
self
.
selectionLayer
.
fillColor
=
color
.
cgColor
//下面代码为添加选中日期背景色
self
.
selectionLayer2
.
fillColor
=
color
.
cgColor
self
.
selectionLayer2
.
frame
=
self
.
contentView
.
bounds
if
selectionType
==
.
middle
{
print
(
"middle--middle"
)
self
.
titleLabel
.
textColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
let
color
=
UIColor
.
white
self
.
selectionLayer
.
fillColor
=
color
.
cgColor
self
.
selectionLayer
.
path
=
UIBezierPath
(
rect
:
self
.
selectionLayer
.
bounds
)
.
cgPath
// let color = UIColor.white
// self.selectionLayer.fillColor = color.cgColor
// self.selectionLayer.path = UIBezierPath(rect: self.selectionLayer.bounds).cgPath
//下面代码为添加选中日期背景色
self
.
selectionLayer
.
fillColor
=
UIColor
(
named
:
"#E0EEFF"
)?
.
cgColor
let
bounds
=
CGRect
(
x
:
0
,
y
:
2
,
width
:
self
.
selectionLayer
.
bounds
.
size
.
width
,
height
:
self
.
selectionLayer
.
bounds
.
height
-
8
)
self
.
selectionLayer
.
path
=
UIBezierPath
(
rect
:
bounds
)
.
cgPath
}
else
if
selectionType
==
.
leftBorder
{
self
.
titleLabel
.
textColor
=
UIColor
.
white
let
color
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
self
.
selectionLayer
.
fillColor
=
color
?
.
cgColor
self
.
selectionLayer
.
fillColor
=
UIColor
(
named
:
"蓝色字体颜色"
)?
.
cgColor
let
diameter
:
CGFloat
=
min
(
self
.
selectionLayer
.
frame
.
height
,
self
.
selectionLayer
.
frame
.
width
)
self
.
selectionLayer
.
path
=
UIBezierPath
(
ovalIn
:
CGRect
(
x
:
self
.
bounds
.
width
/
2
-
diameter
/
2
+
2
,
y
:
self
.
bounds
.
height
/
2
-
diameter
/
2
-
1
,
width
:
diameter
-
4
,
height
:
diameter
-
4
))
.
cgPath
//下面代码为添加选中日期背景色
let
bounds
=
CGRect
(
x
:
self
.
selectionLayer2
.
bounds
.
size
.
width
*
0.5
,
y
:
2
,
width
:
self
.
selectionLayer2
.
bounds
.
size
.
width
,
height
:
self
.
selectionLayer2
.
bounds
.
height
-
8
)
self
.
selectionLayer2
.
fillColor
=
UIColor
(
named
:
"#E0EEFF"
)?
.
cgColor
self
.
selectionLayer2
.
path
=
UIBezierPath
(
rect
:
bounds
)
.
cgPath
print
(
"leftBorder--leftBorder"
)
}
else
if
selectionType
==
.
rightBorder
{
print
(
"rightBorder--rightBorder"
)
self
.
titleLabel
.
textColor
=
UIColor
.
white
let
color
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
self
.
selectionLayer
.
fillColor
=
color
?
.
cgColor
self
.
selectionLayer
.
fillColor
=
UIColor
(
named
:
"蓝色字体颜色"
)?
.
cgColor
let
diameter
:
CGFloat
=
min
(
self
.
selectionLayer
.
frame
.
height
,
self
.
selectionLayer
.
frame
.
width
)
self
.
selectionLayer
.
path
=
UIBezierPath
(
ovalIn
:
CGRect
(
x
:
self
.
bounds
.
width
/
2
-
diameter
/
2
+
2
,
y
:
self
.
bounds
.
height
/
2
-
diameter
/
2
-
1
,
width
:
diameter
-
4
,
height
:
diameter
-
4
))
.
cgPath
//下面代码为添加选中日期背景色
let
bounds
=
CGRect
(
x
:
0
,
y
:
2
,
width
:
self
.
selectionLayer2
.
bounds
.
size
.
width
*
0.5
,
height
:
self
.
selectionLayer2
.
bounds
.
height
-
8
)
self
.
selectionLayer2
.
fillColor
=
UIColor
(
named
:
"#E0EEFF"
)?
.
cgColor
self
.
selectionLayer2
.
path
=
UIBezierPath
(
rect
:
bounds
)
.
cgPath
}
else
if
selectionType
==
.
single
{
let
color
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)
self
.
selectionLayer
.
fillColor
=
color
?
.
cgColor
self
.
selectionLayer
.
fillColor
=
UIColor
.
init
(
named
:
"蓝色字体颜色"
)?
.
cgColor
let
diameter
:
CGFloat
=
min
(
self
.
selectionLayer
.
frame
.
height
,
self
.
selectionLayer
.
frame
.
width
)
self
.
selectionLayer
.
path
=
UIBezierPath
(
ovalIn
:
CGRect
(
x
:
self
.
bounds
.
width
/
2
-
diameter
/
2
+
2
,
y
:
self
.
bounds
.
height
/
2
-
diameter
/
2
-
1
,
width
:
diameter
-
4
,
height
:
diameter
-
4
))
.
cgPath
print
(
"single--single"
)
self
.
titleLabel
.
textColor
=
UIColor
.
white
//下面代码为添加选中日期背景色
self
.
selectionLayer2
.
fillColor
=
UIColor
.
white
.
cgColor
self
.
selectionLayer2
.
path
=
UIBezierPath
(
rect
:
bounds
)
.
cgPath
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment