【发布时间】:2013-07-14 09:24:32
【问题描述】:
我有一个控制器:
- (void)viewDidLoad {
[super viewDidLoad];
// Add a scroolView
self.scroolViewDay.scrollEnabled = YES;
// Compute the content Size of the TableDays
self.scroolViewDay.contentSize = CGSizeMake(self.scroolViewDay.frame.size.width,
80 * 48); // TO MODIFY!
[self.scroolViewDay addSubview:self.tableDays];
[self.tableDays setNeedsDisplay];
}
控制器有一个XIB UIScrollView 所在的位置。
自定义视图 TableDays 有一个自定义的 drawRect,它永远不会被调用:
- (void)drawRect:(CGRect)rect {
NSLog(@"sono in drawRect");
}
为什么?
【问题讨论】:
-
解决办法是初始化框架。看到这个答案:stackoverflow.com/questions/6271681/…
标签: ios uiview uiscrollview drawrect