创建透明的UIToolbar
2024-10-15 07:08:08
TranslucentToolbar.h文件
#import <UIKit/UIKit.h>
@interface TranslucentToolbar :
UIToolbar
@end
TranslucentToolbar.m文件
#import "TranslucentToolbar.h"
@implementation TranslucentToolbar
- (id)initWithFrame:(CGRect)aRect {
if ((self = [super
initWithFrame:aRect])) {
self.opaque =
NO;
self.backgroundColor = [UIColor
colorWithRed:34.0/255.0
green:39.0/255.0
blue:42.0/255.0
alpha:0.8];
self.clearsContextBeforeDrawing =
YES;
}
return
self;
}
- (void)drawRect:(CGRect)rect
{
// Drawing code
}
@end
在须要创建的地方使用子类化的UIToolbar:
_bottomBar =[[TranslucentToolbar
alloc] initWithFrame:CGRectMake(0, height-botH, width, botH)];
最新文章
- 《DSP using MATLAB》第6章开始了
- Android课程---优化ListView列表视图
- 基于注解的Spring AOP的配置和使用--转载
- CentOS yum安装和配置MySQL(转载)
- Bootstrap_Javascript_固定定位
- rest-简介
- unix您不能使用crontab设置运营计划
- bootstrap switch功能
- input和textarea标签的select()方法----选中文本框中的所有文本
- linux服务端日志中截取自己所需要的部分
- 线段树(segment_tree)
- participation remain wide
- [转]RPA简介
- Redis重大版本
- extjs model store学习笔记
- C高级第二次PTA作业
- Java内存模型与共享变量可见性
- SpringBoot中Mybatis打印sql
- 【cs229-Lecture8】顺序最小优化算法
- 学hadoop需要什么基础
热门文章
- jsp界面项目绝对路径问题
- Microsoft Azure云计算第一步—试用帐户申请
- 基于MapReduce的关系代数运算(2)
- Systemd Unit文件中PrivateTmp字段详解-Jason.Zhi
- 根据headerView位置改变headerView颜色(collectionView/tableview)
- hdu4135-Co-prime &; Codeforces 547C Mike and Foam (容斥原理)
- (翻译)异步编程之Promise(1):初见魅力
- 根据路径获得文件名以及Aspose.Cells.dll操作excel 以及使用iTextSharp.text.pdf.PdfReader.dll对PDF的操作
- xiaocms 关于搜索功能 添加搜索字段
- ASP.NET MVC- 解决HTML转码