Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 86372c21
由
cgx
编写于
2022-05-31 09:24:58 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
新开的webview页面加载h5需要隐藏导航栏
1 个父辈
839f910b
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
20 行增加
和
0 行删除
DreamSleep/DreamSleep/Basement/H5/DsWebController.h
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
DreamSleep/DreamSleep/Basement/H5/DsWebController.h
查看文件 @
86372c2
...
@@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
...
@@ -17,6 +17,11 @@ NS_ASSUME_NONNULL_BEGIN
/// @param link 传入h5链接
/// @param link 传入h5链接
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSString
*
)
link
;
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSString
*
)
link
;
/// 初始化方法
/// @param link 传入h5链接
/// @param isShowNavi 是否显示导航栏
-
(
instancetype
)
initWithLink
:(
NSString
*
)
link
isShowNavi
:(
BOOL
)
isShowNavi
;
@end
@end
NS_ASSUME_NONNULL_END
NS_ASSUME_NONNULL_END
DreamSleep/DreamSleep/Basement/H5/DsWebController.m
查看文件 @
86372c2
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
@interface
DsWebController
()
<
WKNavigationDelegate
>
@interface
DsWebController
()
<
WKNavigationDelegate
>
@property
(
nonatomic
,
copy
)
NSString
*
naviTitle
;
@property
(
nonatomic
,
copy
)
NSString
*
naviTitle
;
@property
(
nonatomic
,
strong
)
NSURL
*
linkUrl
;
@property
(
nonatomic
,
strong
)
NSURL
*
linkUrl
;
@property
(
nonatomic
,
assign
)
BOOL
isShowNavi
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
@property
(
nonatomic
,
strong
)
WKWebView
*
webView
;
@property
(
nonatomic
,
strong
)
NSMutableURLRequest
*
request
;
@property
(
nonatomic
,
strong
)
NSMutableURLRequest
*
request
;
@property
(
nonatomic
,
strong
)
UIProgressView
*
progressView
;
@property
(
nonatomic
,
strong
)
UIProgressView
*
progressView
;
...
@@ -23,11 +24,20 @@
...
@@ -23,11 +24,20 @@
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSString
*
)
link
{
-
(
instancetype
)
initWithTitle
:(
NSString
*
)
title
link
:(
NSString
*
)
link
{
if
(
self
=
[
super
init
])
{
if
(
self
=
[
super
init
])
{
self
.
naviTitle
=
title
;
self
.
naviTitle
=
title
;
self
.
isShowNavi
=
YES
;
self
.
linkUrl
=
[
NSURL
URLWithString
:
link
];
self
.
linkUrl
=
[
NSURL
URLWithString
:
link
];
}
}
return
self
;
return
self
;
}
}
-
(
instancetype
)
initWithLink
:(
NSString
*
)
link
isShowNavi
:(
BOOL
)
isShowNavi
{
if
(
self
=
[
super
init
])
{
self
.
linkUrl
=
[
NSURL
URLWithString
:
link
];
self
.
isShowNavi
=
isShowNavi
;
}
return
self
;
}
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
super
viewDidLoad
];
...
@@ -54,6 +64,11 @@
...
@@ -54,6 +64,11 @@
return
NO
;
return
NO
;
}
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
!
self
.
isShowNavi
;
}
#pragma mark - WKWebView的监听方法
#pragma mark - WKWebView的监听方法
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
-
(
void
)
observeValueForKeyPath
:
(
NSString
*
)
keyPath
ofObject
:
(
id
)
object
change
:
(
NSDictionary
<
NSKeyValueChangeKey
,
id
>
*
)
change
context
:
(
void
*
)
context
{
if
([
keyPath
isEqualToString
:
@"estimatedProgress"
])
{
if
([
keyPath
isEqualToString
:
@"estimatedProgress"
])
{
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论