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
f2bf4535
Commit
f2bf4535
authored
Jan 04, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
处理tabBar上的 分割线
parent
0d359cc9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
8 deletions
+48
-8
YHTabBarViewController.swift
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
+41
-7
YHHomeViewController.swift
...axy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
+7
-1
No files found.
galaxy/galaxy/Classes/Base/C/YHTabBarViewController.swift
View file @
f2bf4535
...
@@ -12,13 +12,17 @@ import ESTabBarController_swift
...
@@ -12,13 +12,17 @@ import ESTabBarController_swift
class
YHTabBarViewController
:
ESTabBarController
{
class
YHTabBarViewController
:
ESTabBarController
{
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
handleTabBarLine
()
// self.tabBar.shadowImage = UIImage()
// self.tabBar.backgroundImage = UIImage()
// NotificationCenter.default.addObserver(self, selector: #selector(hideTabBar), name: BsConstant.BsNotification.tabBarHideNotification, object: nil)
//
// NotificationCenter.default.addObserver(self, selector: #selector(showTabBar), name: BsConstant.BsNotification.tabBarShowNotification, object: nil)
// self.tabBar.shadowImage = UIImage()
self
.
tabBar
.
backgroundImage
=
UIImage
()
// NotificationCenter.default.addObserver(self, selector: #selector(hideTabBar), name: BsConstant.BsNotification.tabBarHideNotification, object: nil)
//
// NotificationCenter.default.addObserver(self, selector: #selector(showTabBar), name: BsConstant.BsNotification.tabBarShowNotification, object: nil)
}
}
}
}
...
@@ -26,9 +30,39 @@ extension YHTabBarViewController {
...
@@ -26,9 +30,39 @@ extension YHTabBarViewController {
@objc
func
hideTabBar
()
->
Void
{
@objc
func
hideTabBar
()
->
Void
{
self
.
tabBar
.
isHidden
=
true
self
.
tabBar
.
isHidden
=
true
}
}
@objc
func
showTabBar
()
->
Void
{
@objc
func
showTabBar
()
->
Void
{
self
.
tabBar
.
isHidden
=
false
self
.
tabBar
.
isHidden
=
false
}
}
}
extension
YHTabBarViewController
{
//
func
handleTabBarLine
()
->
Void
{
let
rect
=
CGRect
.
init
(
x
:
0
,
y
:
0
,
width
:
KScreenWidth
,
height
:
1
)
UIGraphicsBeginImageContext
(
rect
.
size
)
let
context
=
UIGraphicsGetCurrentContext
()
let
fillColor
=
YHColorWithHex
(
0xeeeeee
)
context
!.
setFillColor
(
fillColor
.
cgColor
)
context
!.
fill
(
rect
)
let
img
=
UIGraphicsGetImageFromCurrentImageContext
()
UIGraphicsEndImageContext
()
UIView
.
transition
(
with
:
self
.
tabBar
,
duration
:
0.5
,
options
:
.
transitionCrossDissolve
)
{
if
#available(iOS 13.0, *)
{
let
appearance
=
self
.
tabBar
.
standardAppearance
.
copy
()
appearance
.
backgroundImage
=
UIImage
.
init
()
appearance
.
shadowImage
=
img
self
.
tabBar
.
standardAppearance
=
appearance
}
else
{
self
.
tabBar
.
backgroundImage
=
UIImage
.
init
()
self
.
tabBar
.
shadowImage
=
img
}
}
completion
:
{
Bool
in
}
}
}
}
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
View file @
f2bf4535
...
@@ -12,7 +12,13 @@ class YHHomeViewController: YHBaseViewController {
...
@@ -12,7 +12,13 @@ class YHHomeViewController: YHBaseViewController {
override
func
viewDidLoad
()
{
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
super
.
viewDidLoad
()
self
.
title
=
"首页"
initView
()
}
func
initView
()
->
Void
{
navigationItem
.
title
=
"首页"
// view.backgroundColor = YHColorWithHex(0xE9E9E9)
}
}
}
}
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