UIView 的使用
来源:互联网 发布:厦门继续教育网络平台 编辑:程序博客网 时间:2024/04/29 08:36
#pragma mark - /************************ getters setters view **************************/
/**
* setter getter view
*/
//============================" UIView "=============================
//strong 创建view@property (nonatomic, strong) UIView *BgView;- (UIView *)BgView { if (_BgView==nil) { _BgView = [[UIView alloc] initWithFrame:CGRectMake(30, 20, SSWIDTH-60, 300)]; _BgView.backgroundColor = Yellow_COLOR; }return _BgView;}//可以先添加,后调用[self.view addSubview:self.BgView];//weak 创建view@property (nonatomic, weak) UIView *BgView;- (UIView *)BgView { if (_BgView==nil) { UIView *BgView = [[UIView alloc] initWithFrame:CGRectMake(0, 64, SSWIDTH, 50)]; [self.view addSubview:BgView]; _BgView = BgView; }return _BgView;}//用self直接调用//添加多个 view- (void)addViewToSuperView:(UIView *)superView frame:(CGRect)frame tag:(NSInteger)tag{ UIView *myView = [[UIView alloc] initWithFrame:frame]; myView.tag= tag; [superView addSubview:myView]; if (tag==111){ _view1 = myView; }else if (tag==222){ _view2 = myView; }else if (tag==333){ _view3 = myView; }}
// 自定义view
- (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor clearColor]; //iOS设置父视图透明度而不影响子视图 self.backgroundColor = [[UIColor lightGrayColor] colorWithAlphaComponent:0.1];//TableView的背景 self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; [self configUI]; } return self;}- (instancetype)init { self = [super init]; if (self) {[self configUI]; } return self;}- (void)configUI { }
阅读全文
0 0
- 使用自定义的UIView
- UIVIew的使用大全
- UIView 的使用
- swift -UIView的使用
- UIView的使用setNeedsDisplay
- 使用UIView的animation
- UIView的基本使用
- UIView属性的使用
- UIView的属性使用
- UIView的使用
- UIView的使用
- UIView 的使用
- uiview的contentmode的使用
- UIView属性clipsToBounds的使用
- UILabel和UIView的使用
- 8.UIView的基本使用
- UIView的contentMode使用小结
- swift中UIView的使用
- 怎么用云服务器优惠券
- [RK3288][Android6.0] 调试笔记 --- 开机提示mmc rescan错误
- String path = request.getContextPath(....拼装当前网页的相对路径
- 自动气象站网维护保障信息化管理平台
- fork/join框架
- UIView 的使用
- QT控件大全 十五 QOpenChart
- Linux入门(18)——Ubuntu16.04下安装spyder
- SQL SERVER数据库删除LOG文件和清空日志的方案
- Android源码阅读——GIF解码(如何提取各帧图片)
- Learning to Segment Every Thing Ronghang论文学习
- 程序员浏览器之chrome插件篇
- apk反编译快--速入门安全性测试
- 文章标题