iOS,作死集锦

自定义button,重写

- (CGRect)titleRectForContentRect:(CGRect)contentRect

- (CGRect)imageRectForContentRect:(CGRect)contentRect

打印button.imageView和button.titleLabel的frame正常,但就是不显示图片,设置button.imageView背景色也没用。原因是我重写了

- (void)setImage:(UIImage *)image forState:(UIControlState)state

并且没有调用父类方法,哈哈哈,cnm!

posted @ 2015-01-10 11:54  从良少年  阅读(142)  评论(0编辑  收藏  举报