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
ac1b7ec7
Commit
ac1b7ec7
authored
Feb 11, 2025
by
Alex朱枝文
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
根据H5需要,键盘事件换成willShow和willHide
parent
a90f3e0c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
YHHomeWebViewController.swift
.../Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
+6
-6
YHH5WebViewVC.swift
.../Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
+6
-6
No files found.
galaxy/galaxy/Classes/Modules/Home(首页)/C/YHHomeWebViewController.swift
View file @
ac1b7ec7
...
...
@@ -303,10 +303,10 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
}
getData
()
updateNetWorkStatusUI
(
needReload
:
false
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Did
Show(_:)
)
,
name
:
UIResponder
.
keyboard
Did
ShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Did
Hide(_:)
)
,
name
:
UIResponder
.
keyboard
Did
HideNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Will
Show(_:)
)
,
name
:
UIResponder
.
keyboard
Will
ShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Will
Hide(_:)
)
,
name
:
UIResponder
.
keyboard
Will
HideNotification
,
object
:
nil
)
}
...
...
@@ -427,7 +427,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
previewFileTool
.
openXLSXRemoteFile
(
urlString
:
urlString
,
fileName
:
""
)
}
@objc
func
keyboard
Did
Show
(
_
notification
:
Notification
)
{
@objc
func
keyboard
Will
Show
(
_
notification
:
Notification
)
{
guard
let
userInfo
=
notification
.
userInfo
,
let
keyboardFrame
=
userInfo
[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as?
CGRect
else
{
return
}
...
...
@@ -437,7 +437,7 @@ class YHHomeWebViewController: YHBaseViewController, WKUIDelegate, WKNavigationD
webview
.
callHandler
(
"onKeyboardHeightChanged"
,
arguments
:
[
dict
])
}
@objc
func
keyboard
Did
Hide
(
_
notification
:
Notification
)
{
@objc
func
keyboard
Will
Hide
(
_
notification
:
Notification
)
{
// 调用 H5 的 onKeyboardHide 方法
let
dict
=
[
"height"
:
"
\(
0
)
"
]
webview
.
callHandler
(
"onKeyboardHeightChanged"
,
arguments
:
[
dict
])
...
...
galaxy/galaxy/Classes/Modules/InteractionH5(与H5交互)/YHH5WebViewVC.swift
View file @
ac1b7ec7
...
...
@@ -77,10 +77,10 @@ class YHH5WebViewVC: YHBaseViewController, WKUIDelegate, WKNavigationDelegate {
override
func
viewDidLoad
()
{
super
.
viewDidLoad
()
setupUI
()
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Did
Show(_:)
)
,
name
:
UIResponder
.
keyboard
Did
ShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Did
Hide(_:)
)
,
name
:
UIResponder
.
keyboard
Did
HideNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Will
Show(_:)
)
,
name
:
UIResponder
.
keyboard
Will
ShowNotification
,
object
:
nil
)
NotificationCenter
.
default
.
addObserver
(
self
,
selector
:
#selector(
keyboard
Will
Hide(_:)
)
,
name
:
UIResponder
.
keyboard
Will
HideNotification
,
object
:
nil
)
}
override
func
viewWillAppear
(
_
animated
:
Bool
)
{
...
...
@@ -461,7 +461,7 @@ private extension YHH5WebViewVC {
return
!
disableFullScreenGestureFlag
}
@objc
func
keyboard
Did
Show
(
_
notification
:
Notification
)
{
@objc
func
keyboard
Will
Show
(
_
notification
:
Notification
)
{
guard
let
userInfo
=
notification
.
userInfo
,
let
keyboardFrame
=
userInfo
[
UIResponder
.
keyboardFrameEndUserInfoKey
]
as?
CGRect
else
{
return
}
...
...
@@ -471,7 +471,7 @@ private extension YHH5WebViewVC {
webview
.
callHandler
(
"onKeyboardHeightChanged"
,
arguments
:
[
dict
])
}
@objc
func
keyboard
Did
Hide
(
_
notification
:
Notification
)
{
@objc
func
keyboard
Will
Hide
(
_
notification
:
Notification
)
{
// 调用 H5 的 onKeyboardHide 方法
let
dict
=
[
"height"
:
"
\(
0
)
"
]
webview
.
callHandler
(
"onKeyboardHeightChanged"
,
arguments
:
[
dict
])
...
...
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