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
aabe9e56
Commit
aabe9e56
authored
Feb 01, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加 渐变函数 UIView UIButton
parent
faf2526e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
32 deletions
+63
-32
YHHomeBannerView.swift
.../galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
+1
-1
YHPersonInformMainViewController.swift
...nInfoList(个人信息表)/C/YHPersonInformMainViewController.swift
+0
-1
YHContractMainItemStatusCell.swift
...lligentService(服务中心)/V/YHContractMainItemStatusCell.swift
+2
-2
YHInformationFillTipsAlertView.swift
...igentService(服务中心)/V/YHInformationFillTipsAlertView.swift
+13
-9
String+Extension.swift
galaxy/galaxy/Classes/Tools/Extention/String+Extension.swift
+1
-0
UIButton+Extension.swift
...y/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
+27
-1
UIColor+Extension.swift
...xy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
+1
-2
UIFont+Extension.swift
galaxy/galaxy/Classes/Tools/Extention/UIFont+Extension.swift
+6
-6
UIView+Extension.swift
galaxy/galaxy/Classes/Tools/Extention/UIView+Extension.swift
+12
-10
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/V/YHHomeBannerView.swift
View file @
aabe9e56
...
...
@@ -9,7 +9,7 @@
import
Foundation
import
FSPagerView
import
Kingfisher
import
SwifterSwift
//
import SwifterSwift
class
YHHomeBannerView
:
UIView
{
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/ServiceProcess(流程)/PersonInfoList(个人信息表)/C/YHPersonInformMainViewController.swift
View file @
aabe9e56
...
...
@@ -140,7 +140,6 @@ extension YHPersonInformMainViewController {
make
.
left
.
right
.
bottom
.
equalToSuperview
()
}
// homeTableView.backgroundColor = .red//for test hjl
homeTableView
.
tableHeaderView
=
myHeadView
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHContractMainItemStatusCell.swift
View file @
aabe9e56
...
...
@@ -7,7 +7,7 @@
//
import
UIKit
import
SwifterSwift
//
import SwifterSwift
class
YHContractMainItemStatusCell
:
UITableViewCell
{
...
...
@@ -60,7 +60,7 @@ class YHContractMainItemStatusCell: UITableViewCell {
let
gradientLayer
=
CAGradientLayer
()
gradientLayer
.
frame
=
bounds
gradientLayer
.
colors
=
[
UIColor
(
red
:
0.302
,
green
:
0.624
,
blue
:
0.973
,
alpha
:
1
),
UIColor
(
red
:
0.231
,
green
:
0.525
,
blue
:
0.969
,
alpha
:
1
)]
.
map
(\
.
cgColor
)
gradientLayer
.
colors
=
UIColor
.
arrBrandGradaterColors
gradientLayer
.
locations
=
[
0
,
1
]
.
map
{
NSNumber
(
value
:
$0
)
}
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0.12
,
y
:
0.25
)
gradientLayer
.
endPoint
=
CGPoint
(
x
:
0.38
,
y
:
0.25
)
...
...
galaxy/galaxy/Classes/Modules/IntelligentService(服务中心)/V/YHInformationFillTipsAlertView.swift
View file @
aabe9e56
...
...
@@ -42,7 +42,7 @@ class YHInformationFillTipsAlertView: UIView {
tableView
.
showsHorizontalScrollIndicator
=
true
tableView
.
showsVerticalScrollIndicator
=
false
tableView
.
rowHeight
=
UITableView
.
automaticDimension
// tableView.estimatedRowHeight = 100
// tableView.estimatedRowHeight = 100
tableView
.
register
(
YHInformationFillTipsCell
.
self
,
forCellReuseIdentifier
:
YHInformationFillTipsCell
.
cellReuseIdentifier
)
return
tableView
}()
...
...
@@ -60,9 +60,9 @@ class YHInformationFillTipsAlertView: UIView {
override
init
(
frame
:
CGRect
)
{
super
.
init
(
frame
:
frame
)
backgroundColor
=
UIColor
(
white
:
0.5
,
alpha
:
0.1
)
// let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
// tap.delegate = self
// addGestureRecognizer(tap)
// let tap = UITapGestureRecognizer(target: self, action: #selector(handleTap))
// tap.delegate = self
// addGestureRecognizer(tap)
setView
()
}
...
...
@@ -72,11 +72,11 @@ class YHInformationFillTipsAlertView: UIView {
}
func
setView
()
{
backgroundColor
=
UIColor
(
hex
:
0x0000
,
alpha
:
0.5
)
backgroundColor
=
UIColor
(
hex
:
0x0000
00
,
alpha
:
0.5
)
centerView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
.
white
view
.
layer
.
cornerRadius
=
12
view
.
layer
.
cornerRadius
=
8
return
view
}()
addSubview
(
centerView
)
...
...
@@ -96,12 +96,12 @@ class YHInformationFillTipsAlertView: UIView {
}
let
checkBtn
=
UIButton
(
type
:
.
custom
)
checkBtn
.
setBackgroundImage
(
UIImage
.
from
(
color
:
UIColor
(
hex
:
0x4D9FF8
)),
for
:
.
normal
)
checkBtn
.
addTarget
(
self
,
action
:
#selector(
onClickReadyBtn
)
,
for
:
.
touchUpInside
)
checkBtn
.
setTitle
(
"准备完毕"
,
for
:
.
normal
)
checkBtn
.
setTitleColor
(
.
white
,
for
:
.
normal
)
checkBtn
.
addTarget
(
self
,
action
:
#selector(
onClickReadyBtn
)
,
for
:
.
touchUpInside
)
checkBtn
.
layer
.
cornerRadius
=
8
checkBtn
.
clipsToBounds
=
true
bottomView
.
addSubview
(
checkBtn
)
checkBtn
.
snp
.
makeConstraints
{
make
in
make
.
bottom
.
equalToSuperview
()
.
offset
(
-
40
)
...
...
@@ -109,6 +109,10 @@ class YHInformationFillTipsAlertView: UIView {
make
.
right
.
equalTo
(
-
16
)
make
.
height
.
equalTo
(
48
)
}
checkBtn
.
layoutIfNeeded
()
//非常重要!!!!
checkBtn
.
backgroundGradient
()
let
lable00
=
UILabel
(
text
:
"我确认我所提供的材料真实有效,并知悉其中内容。"
)
lable00
.
font
=
kFont
(
size
:
12
)
...
...
@@ -262,7 +266,7 @@ extension YHInformationFillTipsAlertView : UITableViewDelegate,UITableViewDataSo
return
UIView
()
}
func
tableView
(
_
tableView
:
UITableView
,
heightForRowAt
indexPath
:
IndexPath
)
->
CGFloat
{
...
...
galaxy/galaxy/Classes/Tools/Extention/String+Extension.swift
View file @
aabe9e56
...
...
@@ -7,6 +7,7 @@
//
import
UIKit
import
SwifterSwift
extension
String
{
/// JSONString转换为字典
func
toDictionary
()
->
Dictionary
<
String
,
Any
>
{
...
...
galaxy/galaxy/Classes/Tools/Extention/UIButton+Extension.swift
View file @
aabe9e56
...
...
@@ -98,5 +98,31 @@ extension UIButton {
return
btn
}
}
extension
UIButton
{
/// 渐变背景
@discardableResult
func
backgroundGradient
<
T
:
UIButton
>
()
->
T
{
let
gradientLayer
=
CAGradientLayer
()
//几个颜色
gradientLayer
.
colors
=
UIColor
.
arrBrandGradaterColors
.
map
{
$0
.
cgColor
}
//颜色的分界点
gradientLayer
.
locations
=
[
0
,
1.0
]
//开始
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0.12
,
y
:
0.25
)
//结束,主要是控制渐变方向
gradientLayer
.
endPoint
=
CGPoint
(
x
:
0.38
,
y
:
0.25
)
//多大区域
gradientLayer
.
frame
=
bounds
UIGraphicsBeginImageContext
(
gradientLayer
.
frame
.
size
)
if
let
context
=
UIGraphicsGetCurrentContext
()
{
gradientLayer
.
render
(
in
:
context
)
let
outputImage
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
setBackgroundImage
(
outputImage
,
for
:
.
normal
)
}
return
self
as!
T
}
}
galaxy/galaxy/Classes/Tools/Extention/UIColor+Extension.swift
View file @
aabe9e56
...
...
@@ -7,7 +7,7 @@
//
import
UIKit
import
SwifterSwift
//
import SwifterSwift
extension
UIColor
{
...
...
@@ -83,6 +83,5 @@ extension UIColor {
UIGraphicsEndImageContext
()
return
image
!
}
}
galaxy/galaxy/Classes/Tools/Extention/UIFont+Extension.swift
View file @
aabe9e56
...
...
@@ -10,30 +10,30 @@ import UIKit
extension
UIFont
{
// MARK: - 苹果平方字体
//特细
class
func
PFSC_Thin
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
class
func
PFSC_Thin
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangSC-Thin"
,
size
:
size
)
!
}
//细体
class
func
PFSC_L
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
class
func
PFSC_L
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangSC-Light"
,
size
:
size
)
!
}
//常规
class
func
PFSC_R
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
class
func
PFSC_R
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangSC-Regular"
,
size
:
size
)
!
}
//中等
class
func
PFSC_M
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
class
func
PFSC_M
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangSC-Medium"
,
size
:
size
)
!
}
//粗体
static
func
PFSC_B
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
static
func
PFSC_B
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangSC-Semibold"
,
size
:
size
)
!
}
//特粗体
static
func
PFSC_UL
(
ofSize
size
:
CGFloat
=
1
7
)
->
UIFont
{
static
func
PFSC_UL
(
ofSize
size
:
CGFloat
=
1
5
)
->
UIFont
{
return
UIFont
(
name
:
"PingFangTC-Ultralight"
,
size
:
size
)
!
}
...
...
galaxy/galaxy/Classes/Tools/Extention/UIView+Extension.swift
View file @
aabe9e56
...
...
@@ -10,23 +10,25 @@ import Foundation
import
QuartzCore
extension
UIView
{
func
image
(
with
colors
:
[
Any
])
->
UIImage
?
{
addGradualLayer
(
colors
)
return
convertToImage
()
}
func
addGradualLayer
(
_
colors
:
[
Any
])
{
if
colors
.
count
==
0
{
return
}
//添加银河渐变色 //从左到右
func
addYinHeGradualLayer
()
{
let
gradientLayer
=
CAGradientLayer
()
gradientLayer
.
colors
=
colors
gradientLayer
.
colors
=
UIColor
.
arrBrandGradaterColors
.
map
(\
.
cgColor
)
gradientLayer
.
locations
=
[
0
,
1.0
]
gradientLayer
.
startPoint
=
CGPoint
(
x
:
0.12
,
y
:
0.25
)
gradientLayer
.
endPoint
=
CGPoint
(
x
:
0.38
,
y
:
0.25
)
gradientLayer
.
frame
=
self
.
bounds
self
.
layer
.
addSublayer
(
gradientLayer
)
gradientLayer
.
frame
=
bounds
layer
.
addSublayer
(
gradientLayer
)
}
func
image
(
with
colors
:
[
Any
])
->
UIImage
?
{
addYinHeGradualLayer
()
return
convertToImage
()
}
func
convertToImage
()
->
UIImage
?
{
let
size
=
self
.
bounds
.
size
if
size
.
width
<=
0
||
size
.
height
<=
0
{
return
nil
}
...
...
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