setNeedDisplay和setNeedsLayout

[self setNeedsDisplay];//重新调drawRect
- (void)drawRect:(CGRect)rect
{
  //do sth
}
 
[self setNeedsLayout];//重新调layoutSubviews
- (void)layoutSubviews
{
    [super layoutSubviews];
}
posted @ 2015-05-17 10:21  许文斌  阅读(419)  评论(0编辑  收藏  举报