iPhone遮盖系统栏,实现自定义效果的状态栏
2013-03-22 09:24
363 查看
CGRect frame = CGRectMake(0, 0, 320, 20);
UIWindow* wd = [[UIWindow alloc] initWithFrame:frame];
[wd setBackgroundColor:[UIColor clearColor]];
[wd setWindowLevel:UIWindowLevelAlert];
frame = CGRectMake(100, 0, 30, 20);
UIImageView* img = [[UIImageView alloc] initWithFrame:frame];
[img setImage:[UIImage imageNamed:@"00_0103.png"]];
[wd addSubview:img];
[wd makeKeyAndVisible];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
frame.origin.x += 150;
[img setFrame:frame];
[UIView commitAnimations];
上面的代码演示了创建一个小图标从时间的左侧移动到时间右侧的简单效果,喜欢的可以自己实现一些其他的效果
UIWindow* wd = [[UIWindow alloc] initWithFrame:frame];
[wd setBackgroundColor:[UIColor clearColor]];
[wd setWindowLevel:UIWindowLevelAlert];
frame = CGRectMake(100, 0, 30, 20);
UIImageView* img = [[UIImageView alloc] initWithFrame:frame];
[img setImage:[UIImage imageNamed:@"00_0103.png"]];
[wd addSubview:img];
[wd makeKeyAndVisible];
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:2];
frame.origin.x += 150;
[img setFrame:frame];
[UIView commitAnimations];
上面的代码演示了创建一个小图标从时间的左侧移动到时间右侧的简单效果,喜欢的可以自己实现一些其他的效果
相关文章推荐
- iPhone遮盖系统栏,实现自定义效果的状态栏
- ios学习--iPhone遮盖系统栏,实现自定义效果的状态栏
- iPhone遮盖系统栏,实现自定义效果的状态栏
- iPhone遮盖系统栏,实现自定义效果的状态栏
- iPhone遮盖系统栏,实现自定义效果的状态栏
- Android中动画实现单击按钮控制开屏关屏效果(系统animation实现、scrollTo实现、自定义scrollTo实现)
- Android属性动画与自定义View——实现vivo x6更新系统的动画效果
- Android 沉浸式状态栏效果(状态栏与内容完全融合、类似于iphone 7.0系统)
- Android进阶——自定义View之继承系统控件实现自带删除按钮动画效果和软键盘自动悬浮于文本框下方
- 实现自定义效果的状态栏
- Android实现图片轮显效果——自定义ViewPager控件
- Android自定义View——实现理财类APP七日年化收益折线图效果
- 模块管理常规功能自定义系统的设计与实现(27--多个模块之间的关联[3])
- Android:自定义View实现水波进度效果
- JS实现自定义弹出窗体,效果不好
- 实现“全屏”且状态栏盖在上面的效果
- 模块管理常规功能自定义系统的设计与实现(29--多个模块之间的关联[5])
- vue-video-player 通过自定义按钮组件实现全屏切换效果【推荐】
- 翻翻git之---自定义View实现水位上涨效果 WaveProgressView
- 自定义按钮实现水波点击效果