Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
galaxy-iOS
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mobile-group
galaxy-iOS
Commits
f82c5e77
Commit
f82c5e77
authored
May 17, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加渐变色
parent
748eb3de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
30 deletions
+25
-30
YHScorePersonInfoCell.swift
...Service(服务中心)/MyScore(我的评分)/V/YHScorePersonInfoCell.swift
+25
-30
No files found.
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/MyScore(我的评分)/V/YHScorePersonInfoCell.swift
View file @
f82c5e77
...
@@ -52,7 +52,7 @@ class YHScorePersonInfoCell: UITableViewCell {
...
@@ -52,7 +52,7 @@ class YHScorePersonInfoCell: UITableViewCell {
//综合得分
//综合得分
private
lazy
var
scoreLable
:
UILabel
=
{
private
lazy
var
scoreLable
:
UILabel
=
{
let
lable0
=
UILabel
(
text
:
"
92
"
)
let
lable0
=
UILabel
(
text
:
"
0
"
)
lable0
.
textColor
=
UIColor
(
hex
:
0xFFEEB0
)
lable0
.
textColor
=
UIColor
(
hex
:
0xFFEEB0
)
lable0
.
font
=
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
68
)
lable0
.
font
=
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
68
)
lable0
.
textAlignment
=
.
center
lable0
.
textAlignment
=
.
center
...
@@ -94,6 +94,16 @@ class YHScorePersonInfoCell: UITableViewCell {
...
@@ -94,6 +94,16 @@ class YHScorePersonInfoCell: UITableViewCell {
private
let
secondHoldView
=
UIView
()
private
let
secondHoldView
=
UIView
()
var
gradientLayer
:
CAGradientLayer
=
{
let
gradientLayer
=
CAGradientLayer
()
gradientLayer
.
colors
=
[
UIColor
(
hex
:
0xFFF9E3
,
alpha
:
1.0
)
.
cgColor
,
UIColor
(
hex
:
0xFFE895
,
alpha
:
1.0
)
.
cgColor
]
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0.5
,
y
:
0
)
gradientLayer
.
endPoint
=
CGPoint
(
x
:
0.5
,
y
:
1
)
gradientLayer
.
locations
=
[
NSNumber
(
value
:
0.2
)]
gradientLayer
.
frame
=
CGRect
(
x
:
0
,
y
:
0
,
width
:
200
,
height
:
60
)
return
gradientLayer
}()
}
}
extension
YHScorePersonInfoCell
{
extension
YHScorePersonInfoCell
{
...
@@ -206,21 +216,18 @@ extension YHScorePersonInfoCell {
...
@@ -206,21 +216,18 @@ extension YHScorePersonInfoCell {
make
.
edges
.
equalToSuperview
()
make
.
edges
.
equalToSuperview
()
}
}
secondHoldView
.
addSubview
(
scoreLable
)
let
width
=
scoreLable
.
requiredWidth
scoreLable
.
snp
.
makeConstraints
{
make
in
gradientLayer
.
frame
=
CGRect
(
x
:
(
148
-
width
)
/
2.0
,
y
:
(
105
-
80
)
/
2.0
,
width
:
width
,
height
:
80
)
make
.
centerX
.
equalToSuperview
()
make
.
centerY
.
equalToSuperview
()
scoreLable
.
layer
.
frame
=
gradientLayer
.
bounds
}
gradientLayer
.
mask
=
scoreLable
.
layer
secondHoldView
.
layer
.
insertSublayer
(
gradientLayer
,
at
:
0
)
secondHoldView
.
addSubview
(
fenLable
)
fenLable
.
snp
.
makeConstraints
{
make
in
make
.
left
.
equalTo
(
scoreLable
.
snp
.
right
)
.
offset
(
2
)
make
.
bottom
.
equalTo
(
scoreLable
.
snp
.
bottom
)
.
offset
(
-
13
)
}
let
a
:
ASAttributedString
=
.
init
(
"-"
,
.
font
(
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
68
)
??
UIFont
.
PFSC_B
(
ofSize
:
43
)),
.
foreground
(
UIColor
(
hex
:
0xFFEEB0
)))
secondHoldView
.
addSubview
(
fenLable
)
let
b
:
ASAttributedString
=
.
init
(
"分"
,
.
font
(
UIFont
.
PFSC_R
(
ofSize
:
12
)),
.
foreground
(
UIColor
(
hex
:
0xFFEEB0
)))
fenLable
.
frame
=
CGRect
(
x
:
gradientLayer
.
frame
.
origin
.
x
+
width
,
y
:
gradientLayer
.
frame
.
origin
.
y
+
80
-
13
-
17
-
4
,
width
:
18
,
height
:
17
)
scoreLable
.
attributed
.
text
=
a
}
}
...
@@ -234,27 +241,15 @@ extension YHScorePersonInfoCell {
...
@@ -234,27 +241,15 @@ extension YHScorePersonInfoCell {
phoneLable
.
text
=
model
.
userinfo
?
.
mobile
??
"-"
phoneLable
.
text
=
model
.
userinfo
?
.
mobile
??
"-"
let
score
:
String
=
String
(
model
.
total_score
?
.
sum_score
??
0
)
let
score
:
String
=
String
(
model
.
total_score
?
.
sum_score
??
0
)
// let a: ASAttributedString = .init(NSAttributedString(string: score),.font(UIFont(name: "DINAlternate-Bold", size: 68) ?? UIFont.PFSC_B(ofSize: 43)),.foreground(UIColor(hex: 0xFFEEB0)))
// let b: ASAttributedString = .init("分", .font(UIFont.PFSC_M(ofSize: 16)),.foreground(.white))
// scoreLable.attributed.text = a
scoreLable
.
text
=
score
scoreLable
.
text
=
score
scoreLable
.
layoutIfNeeded
()
let
width
=
scoreLable
.
requiredWidth
gradientLayer
.
frame
=
CGRect
(
x
:
(
148
-
width
)
/
2.0
,
y
:
(
105
-
80
)
/
2.0
,
width
:
width
,
height
:
80
)
let
gradientLayer
=
CAGradientLayer
()
scoreLable
.
layer
.
frame
=
gradientLayer
.
bounds
gradientLayer
.
colors
=
[
UIColor
(
hex
:
0xFFF9E3
,
alpha
:
1.0
)
.
cgColor
,
UIColor
(
hex
:
0xFFE895
,
alpha
:
1.0
)
.
cgColor
]
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0
,
y
:
0
)
gradientLayer
.
endPoint
=
CGPoint
(
x
:
1
,
y
:
1
)
gradientLayer
.
locations
=
[
NSNumber
(
value
:
0.2
)]
gradientLayer
.
frame
=
scoreLable
.
bounds
gradientLayer
.
mask
=
scoreLable
.
layer
gradientLayer
.
mask
=
scoreLable
.
layer
secondHoldView
.
layer
.
insertSublayer
(
gradientLayer
,
at
:
0
)
secondHoldView
.
layer
.
insertSublayer
(
gradientLayer
,
at
:
0
)
fenLable
.
frame
=
CGRect
(
x
:
gradientLayer
.
frame
.
origin
.
x
+
width
,
y
:
gradientLayer
.
frame
.
origin
.
y
+
80
-
13
-
17
-
4
,
width
:
18
,
height
:
17
)
}
}
...
...
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