测试测试结果 | ✗ |
语言语言 | Obj-CObjective C |
许可证 | BSD 3.0 |
发布日期上次发布 | 2016年8月 |
由 Steven Mattera 维护。
一个方便的导航控制器子类,用于更改 iOS 7+ 的状态栏背景色,并根据顶级视图控制器或根视图控制器设置状态栏样式和隐藏属性。
CocoaPods 是 Objective-C 的依赖管理器,它自动化并简化了在项目中使用第三方库安装的过程。要使用 CocoaPods 安装此库,只需将以下行添加到 Podfile 中
pod 'LDNavigationController'
将您的 UINavigationController 的类改为 LDNavigationController。然后通过属性检查器自定义状态栏。
名称 | 类型 | 描述 |
---|---|---|
状态栏颜色 | 颜色 | 状态栏背景颜色。 |
状态栏样式链接 | 字符串 | 要使用的状态栏样式(《lightContent》或《darkContent》) |
statusBarHidden | 布尔值 | 设置状态栏隐藏。 |
使用顶部视图控制器的状态栏样式 | 布尔值 | 使用顶部视图控制器的状态栏样式和首选隐藏状态。 |
使用根视图控制器的状态栏样式 | 布尔值 | 使用根视图控制器的状态栏样式和首选隐藏状态。 |
如需进一步帮助,请查看提供的示例。
使用 initWithRootViewController 创建 LDNavigationController 的导航控制器。然后您可以使用以下属性自定义状态栏。
名称 | 描述 |
---|---|
statusBarColor | 状态栏背景颜色。(仅限 iOS 7+!) |
statusBarStyle | 要使用的状态栏样式。(《LDStatusBarStyleLightContent》或《LDStatusBarStyleDarkContent》) |
statusBarHidden | 设置状态栏隐藏。 |
useTopViewControllerStatusBarStyle | 使用顶部视图控制器的状态栏样式和首选隐藏状态。 |
useRootViewControllerStatusBarStyle | 使用根视图控制器的状态栏样式和首选隐藏状态。 |
如需进一步帮助,请查看提供的示例。
LDNavigationController 根据 BSD 3-Clause 许可证发布
Copyright (c) 2014 Lepidus Development, LLC. All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of the Lepidus Development, LLC nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.