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
00386496
Commit
00386496
authored
Jan 10, 2024
by
David黄金龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
首页添加 导航栏view
parent
7e16bce7
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
125 additions
and
11 deletions
+125
-11
YHHomeViewController.swift
...axy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
+56
-11
Contents.json
...Assets.xcassets/Home/home_nav_icon.imageset/Contents.json
+23
-0
Group.png
...Res/Assets.xcassets/Home/home_nav_icon.imageset/Group.png
+0
-0
Group@2x.png
.../Assets.xcassets/Home/home_nav_icon.imageset/Group@2x.png
+0
-0
Group@3x.png
.../Assets.xcassets/Home/home_nav_icon.imageset/Group@3x.png
+0
-0
Contents.json
.../Assets.xcassets/Home/home_nav_msg.imageset/Contents.json
+23
-0
Rectangle 2422.png
...ts.xcassets/Home/home_nav_msg.imageset/Rectangle 2422.png
+0
-0
Rectangle 2422@2x.png
...xcassets/Home/home_nav_msg.imageset/Rectangle 2422@2x.png
+0
-0
Rectangle 2422@3x.png
...xcassets/Home/home_nav_msg.imageset/Rectangle 2422@3x.png
+0
-0
Contents.json
...sets.xcassets/Home/home_nav_search.imageset/Contents.json
+23
-0
Group 33335186.png
...xcassets/Home/home_nav_search.imageset/Group 33335186.png
+0
-0
Group 33335186@2x.png
...ssets/Home/home_nav_search.imageset/Group 33335186@2x.png
+0
-0
Group 33335186@3x.png
...ssets/Home/home_nav_search.imageset/Group 33335186@3x.png
+0
-0
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeViewController.swift
View file @
00386496
...
...
@@ -10,11 +10,12 @@ import Foundation
import
GKNavigationBarSwift
class
YHHomeViewController
:
YHBaseViewController
{
//
C 对应的 VM
//
model 及网络请求
lazy
var
homeReqVM
:
YHHomePageViewModel
=
{
return
YHHomePageViewModel
()
}()
//头部背景图片
lazy
var
headBkgImagV
:
UIImageView
=
{
let
imagV
=
UIImageView
()
imagV
.
image
=
UIImage
(
named
:
"home_head_bkg"
)
...
...
@@ -22,6 +23,47 @@ class YHHomeViewController: YHBaseViewController {
return
imagV
}()
//自定义导航栏
lazy
var
homeNavBarView
:
UIView
=
{
let
view1
=
UIView
()
view1
.
backgroundColor
=
.
clear
view1
.
isUserInteractionEnabled
=
true
let
icon
=
UIImageView
(
image
:
UIImage
(
named
:
"home_nav_icon"
))
icon
.
contentMode
=
.
scaleAspectFill
view1
.
addSubview
(
icon
)
icon
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
left
.
equalToSuperview
()
.
offset
(
16
)
make
.
height
.
equalTo
(
26
)
make
.
width
.
equalTo
(
120
)
}
let
btnMsg
=
UIButton
(
type
:
.
custom
)
btnMsg
.
setImage
(
UIImage
(
named
:
"home_nav_msg"
),
for
:
.
normal
)
view1
.
addSubview
(
btnMsg
)
btnMsg
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
right
.
equalToSuperview
()
.
offset
(
-
16
)
make
.
height
.
width
.
equalTo
(
34
)
}
btnMsg
.
addTarget
(
self
,
action
:
#selector(
tapSearch
)
,
for
:
.
touchUpInside
)
let
btnSearch
=
UIButton
(
type
:
.
custom
)
btnSearch
.
setImage
(
UIImage
(
named
:
"home_nav_search"
),
for
:
.
normal
)
btnSearch
.
addTarget
(
self
,
action
:
#selector(
tapSearch
)
,
for
:
.
touchUpInside
)
view1
.
addSubview
(
btnSearch
)
btnSearch
.
snp
.
makeConstraints
{
make
in
make
.
centerY
.
equalToSuperview
()
make
.
right
.
equalTo
(
btnMsg
.
snp
.
left
)
.
offset
(
-
12
)
make
.
height
.
width
.
equalTo
(
34
)
}
return
view1
}()
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
...
...
@@ -37,9 +79,6 @@ class YHHomeViewController: YHBaseViewController {
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
super
.
viewWillAppear
(
animated
)
//for test hjl
requestData
()
}
private
func
requestData
()
{
...
...
@@ -58,12 +97,7 @@ class YHHomeViewController: YHBaseViewController {
}
private
func
initView
()
->
Void
{
// gk_navTitle = ""
// gk_navBarAlpha = 0.1
// gk_navLineHidden = true
gk_navigationBar
.
isHidden
=
true
view
.
addSubview
(
headBkgImagV
)
headBkgImagV
.
snp
.
makeConstraints
{
make
in
...
...
@@ -72,7 +106,18 @@ class YHHomeViewController: YHBaseViewController {
}
view
.
addSubview
(
homeNavBarView
)
homeNavBarView
.
snp
.
makeConstraints
{
make
in
make
.
top
.
equalTo
(
k_Height_safeAreaInsetsTop
())
make
.
left
.
right
.
equalToSuperview
()
make
.
height
.
equalTo
(
48
)
}
}
}
extension
YHHomeViewController
{
@objc
func
tapSearch
()
{
printLog
(
"*"
)
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_icon.imageset/Contents.json
0 → 100644
View file @
00386496
{
"images"
:
[
{
"filename"
:
"Group.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Group@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Group@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_icon.imageset/Group.png
0 → 100644
View file @
00386496
2.72 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_icon.imageset/Group@2x.png
0 → 100644
View file @
00386496
5.25 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_icon.imageset/Group@3x.png
0 → 100644
View file @
00386496
7.67 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_msg.imageset/Contents.json
0 → 100644
View file @
00386496
{
"images"
:
[
{
"filename"
:
"Rectangle 2422.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Rectangle 2422@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Rectangle 2422@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_msg.imageset/Rectangle 2422.png
0 → 100644
View file @
00386496
868 Bytes
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_msg.imageset/Rectangle 2422@2x.png
0 → 100644
View file @
00386496
1.87 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_msg.imageset/Rectangle 2422@3x.png
0 → 100644
View file @
00386496
2.86 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_search.imageset/Contents.json
0 → 100644
View file @
00386496
{
"images"
:
[
{
"filename"
:
"Group 33335186.png"
,
"idiom"
:
"universal"
,
"scale"
:
"1x"
},
{
"filename"
:
"Group 33335186@2x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"2x"
},
{
"filename"
:
"Group 33335186@3x.png"
,
"idiom"
:
"universal"
,
"scale"
:
"3x"
}
],
"info"
:
{
"author"
:
"xcode"
,
"version"
:
1
}
}
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_search.imageset/Group 33335186.png
0 → 100644
View file @
00386496
1.39 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_search.imageset/Group 33335186@2x.png
0 → 100644
View file @
00386496
3.08 KB
galaxy/galaxy/Res/Assets.xcassets/Home/home_nav_search.imageset/Group 33335186@3x.png
0 → 100644
View file @
00386496
4.59 KB
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