Skip to content

Commit

Permalink
Fixes for iOS6
Browse files Browse the repository at this point in the history
  • Loading branch information
escoz committed Aug 16, 2013
1 parent f164854 commit e4696b3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 6 additions & 7 deletions QClassicAppearance.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ - (void)setDefaults {
self.actionColorDisabled = [UIColor lightGrayColor];
self.actionColorEnabled = [UIColor blackColor];

self.sectionTitleFont = nil;
self.sectionTitleFont = [UIFont boldSystemFontOfSize:16];
self.sectionTitleShadowColor = [UIColor colorWithWhite:1.0 alpha:1];
self.sectionTitleColor = [UIColor colorWithRed:0.298039 green:0.337255 blue:0.423529 alpha:1.000];

Expand Down Expand Up @@ -55,12 +55,12 @@ - (void)setDefaults {

- (UIView *)buildHeaderForSection:(QSection *)section andTableView:(QuickDialogTableView *)tableView andIndex:(NSInteger)index{
if (self.sectionTitleFont!=nil && tableView.style == UITableViewStyleGrouped){
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, 40)];
containerView.tag = 98989;
CGFloat height = [tableView.delegate tableView:tableView heightForHeaderInSection:index];
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, height)];
containerView.backgroundColor = [UIColor clearColor];
containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 10, tableView.frame.size.width-40, [tableView.delegate tableView:tableView heightForHeaderInSection:index])];
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(20, 8, tableView.frame.size.width-40, height-4)];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth;
label.text = section.title;
[containerView addSubview:label];
Expand All @@ -81,7 +81,6 @@ - (UIView *)buildFooterForSection:(QSection *)section andTableView:(QuickDialogT
if (self.sectionFooterFont!=nil && tableView.style == UITableViewStyleGrouped){
CGSize textSize = [section.footer sizeWithFont:self.sectionFooterFont constrainedToSize:CGSizeMake(tableView.frame.size.width-40, 1000000)];
UIView *containerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.frame.size.width, textSize.height+8)];
containerView.tag = 89898;
containerView.backgroundColor = [UIColor clearColor];
containerView.autoresizingMask = UIViewAutoresizingFlexibleWidth;

Expand Down Expand Up @@ -120,15 +119,15 @@ - (CGFloat)heightForHeaderInSection:(QSection *)section andTableView:(QuickDialo
CGFloat stringTitleHeight = 0;

if (section.title != nil) {
CGFloat maxWidth = tableView.bounds.size.width - 20;
CGFloat maxWidth = tableView.bounds.size.width - (section.rootElement.grouped ? 40 : 20);
CGFloat maxHeight = 9999;
CGSize maximumLabelSize = CGSizeMake(maxWidth,maxHeight);
QAppearance *appearance = ((QuickDialogTableView *)tableView).root.appearance;
CGSize expectedLabelSize = [section.title sizeWithFont:appearance==nil? [UIFont systemFontOfSize:[UIFont labelFontSize]] : appearance.sectionTitleFont
constrainedToSize:maximumLabelSize
lineBreakMode:NSLineBreakByWordWrapping];

stringTitleHeight = expectedLabelSize.height+23.f;
stringTitleHeight = expectedLabelSize.height+24.f;
}


Expand Down
3 changes: 2 additions & 1 deletion quickdialog/QuickDialogTableView.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ - (void)applyAppearanceForRoot:(QRootElement *)element {
if (element.appearance.tableBackgroundView!=nil)
self.backgroundView = element.appearance.tableBackgroundView;

self.separatorColor = element.appearance.tableSeparatorColor;
if (element.appearance.tableSeparatorColor!=nil)
self.separatorColor = element.appearance.tableSeparatorColor;

}

Expand Down

0 comments on commit e4696b3

Please sign in to comment.