iOS 自定义控件--重写一些方法

学习源码是提升自己的一个很好的方法,在我们封装自己的控件的时候,可以重写一些方法。并且重写了当加载页面的时候会自动走这些方法。如

UIbutton中的几个方法

- (CGRect)backgroundRectForBounds:(CGRect)bounds;

- (CGRect)contentRectForBounds:(CGRect)bounds;

- (CGRect)titleRectForContentRect:(CGRect)contentRect;

- (CGRect)imageRectForContentRect:(CGRect)contentRect;

 

posted on 2016-06-02 10:48  hansbsf  阅读(307)  评论(0编辑  收藏  举报

导航