页: 1
const CGSize kTileSize = { 46.f, 44.f };
我将该法典改成一种财产,使你能够动态地确定该框架。
在KalGridView中。 页: 1
const CGSize kTileSize = { 109.0f, 109.0f };
页: 1 页: 1
- (void)addSubviewsToHeaderView:(UIView *)headerView
…
for (CGFloat xOffset = 0.f; xOffset < headerView.width; xOffset += 109.f, i = (i+1)%7) {
CGRect weekdayFrame = CGRectMake(xOffset, 30.f, 109.f, kHeaderHeight - 29.f);
UILabel *weekdayLabel = [[UILabel alloc] initWithFrame:weekdayFrame];
weekdayLabel.backgroundColor = [UIColor clearColor];
weekdayLabel.font = [UIFont boldSystemFontOfSize:10.f];
weekdayLabel.textAlignment = UITextAlignmentCenter;
weekdayLabel.textColor = [UIColor colorWithRed:0.3f green:0.3f blue:0.3f alpha:1.f];
weekdayLabel.shadowColor = [UIColor whiteColor];
weekdayLabel.shadowOffset = CGSizeMake(0.f, 1.f);
weekdayLabel.text = [weekdayNames objectAtIndex:i];
[headerView addSubview:weekdayLabel];
[weekdayLabel release];
}
}
结果: