[Objective-C] 纯文本查看 复制代码
-(void)addButton { }
float h =20; //尺寸定义
float w =self.backgroundView.bounds.size.width;
CGRect rect =CGRectMake(0,self.bounds.size.height-h, w, h);
UIButton *btn = [ [ UIButtonalloc ] initWithFrame:rect ];
btn.backgroundColor = [ UIColoryellowColor ];
btn.tag=100; //添加标记,后说
[self.contentView addSubview: btn ]; //加到contentView
}