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
0f0d9f8e
Commit
0f0d9f8e
authored
May 19, 2024
by
Steven杜宇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
// 验证码UI更新
parent
08a31016
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
15 deletions
+23
-15
YHSmsCodeInputView.swift
...asses/Modules/Login(登录)/V/验证码输入框/YHSmsCodeInputView.swift
+7
-7
YHSmsCodeView.swift
...xy/Classes/Modules/Login(登录)/V/验证码输入框/YHSmsCodeView.swift
+16
-8
No files found.
galaxy/galaxy/Classes/Modules/Login(登录)/V/验证码输入框/YHSmsCodeInputView.swift
View file @
0f0d9f8e
...
...
@@ -10,16 +10,16 @@ import UIKit
// 输入框UI显示配置
struct
YHSmsCodeViewConfig
{
var
textColor
:
UIColor
?
=
UIColor
(
hex
:
0x
000000
)
var
bgColor
:
UIColor
?
=
UIColor
(
hex
:
0xebeef4
)
var
cursorColor
:
UIColor
?
=
UIColor
.
brandMainColor
var
font
:
UIFont
?
=
.
systemFont
(
ofSize
:
20
)
var
textColor
:
UIColor
?
=
UIColor
(
hex
:
0x
FFFFFF
)
var
bgColor
:
UIColor
?
=
UIColor
.
clear
var
cursorColor
:
UIColor
?
=
UIColor
.
white
var
font
:
UIFont
?
=
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
18
)
// 展示输入框个数
var
count
:
Int
=
6
var
width
:
Double
=
4
5
.0
var
height
:
Double
=
50
.0
var
width
:
Double
=
4
6
.0
var
height
:
Double
=
46
.0
// 输入框之间间距
var
gap
:
Double
=
1
0
var
gap
:
Double
=
1
2
}
let
codeViewBaseTag
=
9527
...
...
galaxy/galaxy/Classes/Modules/Login(登录)/V/验证码输入框/YHSmsCodeView.swift
View file @
0f0d9f8e
...
...
@@ -15,12 +15,12 @@ class YHSmsCodeView: UIView {
if
showCursor
{
self
.
cursor
.
layer
.
removeAllAnimations
()
self
.
animaitonShow
(
true
)
self
.
layer
.
borderWidth
=
1
self
.
layer
.
borderColor
=
UIColor
.
brandMainColor
.
cgColor
self
.
bottomLine
.
backgroundColor
=
.
white
}
else
{
self
.
cursor
.
layer
.
removeAllAnimations
()
self
.
cursor
.
isHidden
=
true
self
.
layer
.
borderWidth
=
0
self
.
bottomLine
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xFFFFFF
,
alpha
:
0.6
)
}
}
}
...
...
@@ -33,16 +33,22 @@ class YHSmsCodeView: UIView {
let
label
=
UILabel
()
label
.
textColor
=
.
white
label
.
textAlignment
=
.
center
label
.
font
=
UIFont
.
systemFont
(
ofSize
:
20
)
label
.
font
=
UIFont
(
name
:
"DINAlternate-Bold"
,
size
:
18
)
return
label
}()
var
cursor
:
UIView
=
{
lazy
var
cursor
:
UIView
=
{
let
cursor
=
UIView
()
cursor
.
backgroundColor
=
UIColor
.
brandMainColor
cursor
.
backgroundColor
=
UIColor
.
white
cursor
.
isHidden
=
true
return
cursor
}()
lazy
var
bottomLine
:
UIView
=
{
let
view
=
UIView
()
view
.
backgroundColor
=
UIColor
.
init
(
hex
:
0xFFFFFF
,
alpha
:
0.6
)
return
view
}()
required
init
?(
coder
:
NSCoder
)
{
super
.
init
(
coder
:
coder
)
...
...
@@ -57,10 +63,11 @@ class YHSmsCodeView: UIView {
self
.
isUserInteractionEnabled
=
false
self
.
layer
.
cornerRadius
=
kCornerRadius3
self
.
clipsToBounds
=
true
self
.
backgroundColor
=
UIColor
(
white
:
1
,
alpha
:
0.3
)
self
.
backgroundColor
=
.
clear
self
.
addSubview
(
label
)
self
.
addSubview
(
cursor
)
self
.
addSubview
(
bottomLine
)
}
@objc
func
animaitonShow
(
_
show
:
Bool
)
{
...
...
@@ -81,7 +88,8 @@ class YHSmsCodeView: UIView {
override
func
layoutSubviews
()
{
self
.
label
.
frame
=
self
.
bounds
self
.
cursor
.
bounds
=
CGRectMake
(
0
,
0
,
1
.5
,
self
.
frame
.
size
.
height
-
20
);
self
.
cursor
.
bounds
=
CGRectMake
(
0
,
0
,
1
,
17
);
self
.
cursor
.
center
=
CGPoint
(
x
:
CGRectGetMidX
(
self
.
bounds
)
,
y
:
CGRectGetMidY
(
self
.
bounds
))
self
.
bottomLine
.
frame
=
CGRect
(
x
:
0
,
y
:
self
.
frame
.
size
.
height
-
1
,
width
:
self
.
frame
.
size
.
width
,
height
:
1
)
}
}
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