Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
陈高翔
/
DreamSleep-iOS
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit 833c9dee
由
cgx
编写于
2022-04-15 18:30:31 +0800
浏览文件
选项
浏览文件
标签
下载
电子邮件补丁
差异文件
状态栏处理(导航栏控制和页面单独控制)
1 个父辈
e2200162
隐藏空白字符变更
内嵌
并排
正在显示
10 个修改的文件
包含
67 行增加
和
14 行删除
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
DreamSleep/DreamSleep/Category/DSNavigationTools/NaviBarHandlerProtocol.h
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.h
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.m
DreamSleep/DreamSleep/DSConfig/Info.plist
DreamSleep/DreamSleep/Launcher/LeadingController.m
DreamSleep/DreamSleep/Main/AppDelegate.m
DreamSleep/DreamSleep/Main/BaseNaviController.m
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
DreamSleep/DreamSleep/Profile/ProfileController.m
DreamSleep/DreamSleep.xcodeproj/project.pbxproj
查看文件 @
833c9de
...
...
@@ -911,6 +911,7 @@
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-Dev";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
...
...
@@ -956,9 +957,10 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠";
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠
-Dev
";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
...
...
@@ -1062,9 +1064,10 @@
GENERATE_INFOPLIST_FILE = YES;
HEADER_SEARCH_PATHS = "$(inherited)/**";
INFOPLIST_FILE = DreamSleep/DSConfig/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
Beta
";
INFOPLIST_KEY_CFBundleDisplayName = "小梦睡眠-
Dev
";
INFOPLIST_KEY_UIApplicationSupportsIndirectInputEvents = YES;
INFOPLIST_KEY_UILaunchStoryboardName = LaunchScreen;
INFOPLIST_KEY_UIStatusBarHidden = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
...
...
DreamSleep/DreamSleep/Category/DSNavigationTools/NaviBarHandlerProtocol.h
查看文件 @
833c9de
...
...
@@ -12,11 +12,13 @@
- NaviStyleDefault: 默认
- NaviStyleLight : Light
- NaviStyleDark : Dark
- NaviStyleUndef:未定义
*/
typedef
NS_ENUM
(
NSUInteger
,
NaviStyle
)
{
NaviStyleDefault
,
NaviStyleLight
,
NaviStyleDark
,
NaviStyleUndef
};
#import <Foundation/Foundation.h>
...
...
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.h
查看文件 @
833c9de
...
...
@@ -7,7 +7,7 @@
//
#import <UIKit/UIKit.h>
#import "NaviBarHandlerProtocol.h"
@interface
UIViewController
(
Swizzling
)
<
NaviBarHandlerProtocol
>
@end
DreamSleep/DreamSleep/Category/DSNavigationTools/UIViewController+Swizzling.m
查看文件 @
833c9de
...
...
@@ -56,7 +56,9 @@
[
BaseNaviController
setNavigationBarStyle
:[
self
navigationBarStyle
]
vc
:
self
];
}
else
{
// 默认风格
[
BaseNaviController
setNavigationBarStyle
:
NaviStyleDefault
vc
:
self
];
if
(
self
.
navigationController
)
{
[
BaseNaviController
setNavigationBarStyle
:
NaviStyleDefault
vc
:
self
];
}
}
#pragma mark - 重返系统事件
...
...
DreamSleep/DreamSleep/DSConfig/Info.plist
查看文件 @
833c9de
...
...
@@ -31,5 +31,7 @@
<array>
<string>
audio
</string>
</array>
<key>
UIStatusBarStyle
</key>
<string>
UIStatusBarStyleLightContent
</string>
</dict>
</plist>
DreamSleep/DreamSleep/Launcher/LeadingController.m
查看文件 @
833c9de
...
...
@@ -16,10 +16,15 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
self
.
view
=
self
.
leadView
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
}
-
(
LeadView
*
)
leadView
{
if
(
!
_leadView
)
{
_leadView
=
[[
LeadView
alloc
]
initWithFrame
:
self
.
view
.
bounds
];
...
...
DreamSleep/DreamSleep/Main/AppDelegate.m
查看文件 @
833c9de
...
...
@@ -22,13 +22,12 @@
self
.
window
.
backgroundColor
=
DSWhite
;
[
self
.
window
makeKeyAndVisible
];
UIStoryboard
*
mainStoryBoard
=
[
UIStoryboard
storyboardWithName
:
@"Main"
bundle
:
nil
];
self
.
window
.
rootViewController
=
[
mainStoryBoard
instantiateViewControllerWithIdentifier
:
@"mainSB"
];
//
self.window.rootViewController = [mainStoryBoard instantiateViewControllerWithIdentifier:@"mainSB"];
//
BaseNaviController *navi = [[BaseNaviController alloc] initWithRootViewController:[[PrivacyViewController alloc] init]];
//
self.window.rootViewController = navi;
BaseNaviController
*
navi
=
[[
BaseNaviController
alloc
]
initWithRootViewController
:[[
PrivacyViewController
alloc
]
init
]];
self
.
window
.
rootViewController
=
navi
;
[
self
initWeChat
];
[
self
initYTKNetwork
];
return
YES
;
}
...
...
@@ -48,10 +47,6 @@
// }];
}
-
(
void
)
initYTKNetwork
{
}
-
(
BOOL
)
application
:
(
UIApplication
*
)
app
openURL
:
(
NSURL
*
)
url
options
:
(
NSDictionary
<
UIApplicationOpenURLOptionsKey
,
id
>
*
)
options
{
return
[
WXApi
handleOpenURL
:
url
delegate
:
self
];
}
...
...
DreamSleep/DreamSleep/Main/BaseNaviController.m
查看文件 @
833c9de
...
...
@@ -38,10 +38,12 @@
titleColor
=
ColorFromHex
(
0x333333
);
bgColor
=
DSWhite
;
barTintColor
=
DSWhite
;
// naviBar.barStyle = UIBarStyleDefault;
}
else
if
(
style
==
NaviStyleDark
)
{
titleColor
=
DSWhite
;
bgColor
=
DarkColor
;
barTintColor
=
DarkColor
;
// naviBar.barStyle = UIBarStyleBlack;
}
// 设置导航栏title颜色、导航栏背景色、隐藏分割线
...
...
@@ -71,4 +73,31 @@
}
}
/*
状态栏风格设置:
1、如果UIViewController由导航控制器管理,则状态栏风格由导航栏preferredStatusBarStyle决定;
2、如果UIViewController没有由导航控制器管理,则需要单独在控制器种进行设置
//#pragma mark - 设置状态栏文字颜色
//- (UIStatusBarStyle)preferredStatusBarStyle {
// return UIStatusBarStyleLightContent;
//}
//#pragma mark - 隐藏状态栏
//- (BOOL)prefersStatusBarHidden {
// return YES;
//}
*/
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
// 白天和黑夜2种模式
UIStatusBarStyle
barStyle
=
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
// 默认风格模式(控制器重写navigationBarStyle方法)
UIViewController
*
topVC
=
self
.
topViewController
;
if
([
topVC
respondsToSelector
:
@selector
(
navigationBarStyle
)])
{
NaviStyle
sty
=
(
NaviStyle
)[
topVC
performSelector
:
@selector
(
navigationBarStyle
)];
if
(
sty
==
NaviStyleDefault
)
{
barStyle
=
UIStatusBarStyleLightContent
;
}
}
return
barStyle
;
}
@end
DreamSleep/DreamSleep/PrivacyPolicy/PrivacyViewController.m
查看文件 @
833c9de
...
...
@@ -63,6 +63,21 @@
return
NO
;
}
#pragma mark - H5页面导航栏为默认模式
-
(
NaviStyle
)
navigationBarStyle
{
return
self
.
isDetail
?
NaviStyleDefault
:
NaviStyleUndef
;
}
#pragma mark - 设置状态栏文字颜色
-
(
UIStatusBarStyle
)
preferredStatusBarStyle
{
if
(
self
.
isDetail
)
{
// 导航栏显示不会执行以下代码
return
UIStatusBarStyleLightContent
;
}
else
{
return
[
self
.
dk_manager
.
themeVersion
isEqualToString
:
DKThemeVersionNormal
]
?
UIStatusBarStyleDefault
:
UIStatusBarStyleLightContent
;
}
}
-
(
void
)
showPrivacyView
{
self
.
policyView
=
[[
PrivacyView
alloc
]
init
];
[
self
.
view
addSubview
:
self
.
policyView
];
...
...
DreamSleep/DreamSleep/Profile/ProfileController.m
查看文件 @
833c9de
...
...
@@ -23,7 +23,7 @@
self
.
tmpDatas
=
@[
@"注册登录信息"
,
@"意见反馈"
,
@"系统设置"
,
@"邀请好友"
,
@"关于我们"
,
@"前往小程序"
,
@"关注公众号"
,
@"添加客服微信"
,
@"失眠的认知行为疗法"
,
@"模拟Apple登录"
];
}
#pragma mark - 导航栏
日间、黑夜
模式
#pragma mark - 导航栏
默认
模式
-
(
NaviStyle
)
navigationBarStyle
{
return
NaviStyleDefault
;
}
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论