自定义iOS的状态栏
来源:互联网 发布:游戏门户网站源码php 编辑:程序博客网 时间:2024/06/07 17:59
?
1
2
3
4
5
6
7
8
9
@interface CustomStatusBar
:
UIWindow
{
UILabel
*
_messageLabel;
}
-
(
void
)
showStatusMessage
:
(
NSString
*
)
message
;
-
(
void
)
hide
;
@
end
?
1
2
self.frame
=
[UIApplicationsharedApplication].statusBarFrame;
self.backgroundColor
=
[UIColor blackColor];
?
1
2
3
4
const UIWindowLevelUIWindowLevelNormal;
const UIWindowLevelUIWindowLevelAlert;
const UIWindowLevelUIWindowLevelStatusBar;
typedef CGFloat UIWindowLevel;
?
1
self.windowLevel
=
UIWindowLevelStatusBar
+
1.0
f;
?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
-
(
void
)
showStatusMessage
:
(
NSString
*
)
message
{
self.
hidden
=
NO;
self.alpha
=
1.0
f;
_messageLabel.
text
=
@
""
;
CGSizetotalSize
=
self.frame.size;
self.frame
=
(
CGRect
)
{
self.frame.origin
,
0
,
totalSize.height
}
;
[UIViewanimateWithDuration
:
0.5
fanimations
:
^
{
self.frame
=
(
CGRect
)
{
self.frame.origin
,
totalSize
}
;
}
completion
:
^
(
BOOLfinished
)
{
_messageLabel.
text
=
message
;
}
];
}
-
(
void
)
hide
{
self.alpha
=
1.0
f;
[UIViewanimateWithDuration
:
0.5
fanimations
:
^
{
self.alpha
=
0.0
f;
}
completion
:
^
(
BOOLfinished
)
{
_messageLabel.
text
=
@
""
;
self.
hidden
=
YES;
}
];;
}
0 0
- 自定义iOS的状态栏
- 自定义iOS的状态栏
- 自定义iOS的状态栏
- 自定义iOS的状态栏
- 自定义iOS的状态栏
- 自定义iOS的状态栏
- ios开发笔记--状态栏的自定义,隐藏
- ios开发笔记--状态栏的自定义,隐藏
- ios开发笔记--状态栏的自定义,隐藏
- 自定义ios 状态栏
- IOS自定义状态栏
- iOS自定义状态栏
- ios状态栏操作及自定义状态栏
- ios 状态栏 覆盖自定义View
- iOS-iphone自定义状态栏
- ios 状态栏 覆盖自定义View
- IOS自定义状态栏代码解析
- iOS-iphone自定义状态栏
- Lable加载 类似QQ表情 …
- AFNetwork作用和用法详解
- ios开发中的基本设计模式
- UITableView 动态增加删除行
- ios下拉刷新,基于EGOTableV…
- 自定义iOS的状态栏
- IOS调用系统代码
- 高速pcb的一些要求
- ios本地通知和远程通知
- js与jsp的区别
- NSPredicate
- LeetCode 230. Kth Smallest Element in a BST
- 5.(高级)CS效果之:边框border
- IOS APP 真机测试步骤