Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit ecff3739
由
cgx
编写于
2022-04-23 01:08:12 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
解决UIImagePickerController导航透明问题
1 个父辈
d8bd551b
显示空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
41 行增加
和
14 行删除
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.m
DreamSleep/DreamSleep/HomeModule/FallAsleep/ThreeMinuteController.m
DreamSleep/DreamSleep/Profile/Account/JWMImagePickerController.m
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.m
查看文件 @
ecff373
...
@@ -9,7 +9,6 @@
...
@@ -9,7 +9,6 @@
#import "UIViewController+Swizzling.h"
#import "UIViewController+Swizzling.h"
#import "BaseNaviController.h"
#import "BaseNaviController.h"
#import <objc/runtime.h>
#import <objc/runtime.h>
#import "JWMImagePickerController.h"
@implementation
UIViewController
(
Swizzling
)
@implementation
UIViewController
(
Swizzling
)
...
@@ -53,22 +52,15 @@
...
@@ -53,22 +52,15 @@
self
.
navigationController
.
navigationBarHidden
=
([
self
respondsToSelector
:
@selector
(
isShowNavigationBar
)]
&&
[
self
isShowNavigationBar
]
==
YES
)
?
YES
:
NO
;
self
.
navigationController
.
navigationBarHidden
=
([
self
respondsToSelector
:
@selector
(
isShowNavigationBar
)]
&&
[
self
isShowNavigationBar
]
==
YES
)
?
YES
:
NO
;
#pragma mark - 根据不同页面设置不同的导航栏风格
#pragma mark - 根据不同页面设置不同的导航栏风格
NSString
*
className
=
NSStringFromClass
([
self
class
]);
NSArray
*
classArrary
=
@[
@"JWMImagePickerController"
,
@"CAMImagePickerCameraViewController"
,
@"CAMViewfinderViewController"
,
@"CAMPreviewViewController"
,
@"UIInputWindowController"
,
@"UIEditingOverlayViewController"
,
@"PUPhotoPickerHostViewController"
,
@"PLPhotoTileViewController"
];
// 排除系统相机和相册
if
(
!
[
classArrary
containsObject
:
className
])
{
if
([
self
respondsToSelector
:
@selector
(
navigationBarStyle
)])
{
if
([
self
respondsToSelector
:
@selector
(
navigationBarStyle
)])
{
[
BaseNaviController
setNavigationBarStyle
:[
self
navigationBarStyle
]
vc
:
self
];
[
BaseNaviController
setNavigationBarStyle
:[
self
navigationBarStyle
]
vc
:
self
];
}
else
{
// 默认风格
if
(
self
.
navigationController
)
{
[
BaseNaviController
setNavigationBarStyle
:
NaviStyleDefault
vc
:
self
];
}
}
}
}
// 系统拍照和相册页面调试
// NSString *className = NSStringFromClass([self class]);
// NSArray *classArrary = @[@"JWMImagePickerController",
// @"CAMImagePickerCameraViewController", @"CAMViewfinderViewController", @"CAMPreviewViewController",
// @"UIInputWindowController", @"UIEditingOverlayViewController", @"PUPhotoPickerHostViewController",
// @"PLPhotoTileViewController"];
#pragma mark - 处理用户打开自动切换主题按钮,根据设定好的时间段进行主题切换
#pragma mark - 处理用户打开自动切换主题按钮,根据设定好的时间段进行主题切换
if
(
kGetUserDefaultsBOOL
(
ThemeAutoSwitch
))
{
if
(
kGetUserDefaultsBOOL
(
ThemeAutoSwitch
))
{
...
...
DreamSleep/DreamSleep/HomeModule/FallAsleep/ThreeMinuteController.m
查看文件 @
ecff373
...
@@ -20,4 +20,18 @@
...
@@ -20,4 +20,18 @@
// 加载unity
// 加载unity
}
}
-
(
void
)
touchesBegan
:
(
NSSet
<
UITouch
*>
*
)
touches
withEvent
:
(
UIEvent
*
)
event
{
[
self
.
navigationController
popViewControllerAnimated
:
YES
];
}
#pragma mark - 隐藏导航栏
-
(
BOOL
)
isShowNavigationBar
{
return
YES
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
return
UIStatusBarStyleLightContent
;
}
@end
@end
DreamSleep/DreamSleep/Profile/Account/JWMImagePickerController.m
查看文件 @
ecff373
...
@@ -29,6 +29,27 @@
...
@@ -29,6 +29,27 @@
return
self
;
return
self
;
}
}
#pragma mark - 解决UIImagePickerController导航透明问题
-
(
void
)
navigationController
:(
UINavigationController
*
)
navigationController
willShowViewController
:(
UIViewController
*
)
viewController
animated
:(
BOOL
)
animated
{
if
([
navigationController
isKindOfClass
:[
UIImagePickerController
class
]])
{
self
.
navigationBarHidden
=
YES
;
if
(
@available
(
iOS
13
.
0
,
*
))
{
UINavigationBarAppearance
*
appearance
=
[
UINavigationBarAppearance
new
];
// 导航栏背景色
appearance
.
backgroundColor
=
DSBlack
;
// 隐藏分割线
appearance
.
shadowColor
=
DSClearColor
;
// 生效
self
.
navigationBar
.
scrollEdgeAppearance
=
appearance
;
// 滚动视图滚动后导航栏背景色不会被影响
self
.
navigationBar
.
standardAppearance
=
appearance
;
}
}
}
-
(
void
)
imagePickerController
:(
UIImagePickerController
*
)
picker
didFinishPickingMediaWithInfo
:(
NSDictionary
<
NSString
*
,
id
>
*
)
info
{
-
(
void
)
imagePickerController
:(
UIImagePickerController
*
)
picker
didFinishPickingMediaWithInfo
:(
NSDictionary
<
NSString
*
,
id
>
*
)
info
{
UIImage
*
editedImage
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
UIImage
*
editedImage
=
[
info
objectForKey
:
UIImagePickerControllerOriginalImage
];
[
picker
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[
picker
dismissViewControllerAnimated
:
YES
completion
:
nil
];
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论