forked from futuretap/InAppSettingsKit
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved field layout of MultiValue, TitleValue and Toggle fields;
fixed display issue with tableView separator
- Loading branch information
Ortwin Gentz
committed
Mar 5, 2010
1 parent
76de594
commit 03d6407
Showing
9 changed files
with
135 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// IASKPSTitleValueSpecifierViewCell.h | ||
// InAppSettingsKitSampleApp | ||
// | ||
// Created by Ortwin Gentz on 04.03.10. | ||
// Copyright 2010 FutureTap. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
|
||
@interface IASKPSTitleValueSpecifierViewCell : UITableViewCell | ||
|
||
@end |
48 changes: 48 additions & 0 deletions
48
InAppSettingsKit/Views/IASKPSTitleValueSpecifierViewCell.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
// | ||
// IASKPSTitleValueSpecifierViewCell.m | ||
// InAppSettingsKitSampleApp | ||
// | ||
// Created by Ortwin Gentz on 04.03.10. | ||
// Copyright 2010 FutureTap. All rights reserved. | ||
// | ||
|
||
#import "IASKPSTitleValueSpecifierViewCell.h" | ||
#import "IASKSettingsReader.h" | ||
|
||
|
||
@implementation IASKPSTitleValueSpecifierViewCell | ||
|
||
- (void)layoutSubviews { | ||
// left align the value if the title is empty | ||
if (!self.textLabel.text.length) { | ||
self.textLabel.text = self.detailTextLabel.text; | ||
self.detailTextLabel.text = nil; | ||
if ([self.reuseIdentifier isEqualToString:kIASKPSMultiValueSpecifier]) { | ||
self.textLabel.font = [UIFont systemFontOfSize:[UIFont labelFontSize]]; | ||
self.textLabel.textColor = self.detailTextLabel.textColor; | ||
} | ||
} | ||
[super layoutSubviews]; | ||
|
||
CGFloat viewWidth = [self.textLabel superview].frame.size.width; | ||
|
||
// set the left title label frame | ||
CGFloat labelWidth = [self.textLabel sizeThatFits:CGSizeZero].width; | ||
labelWidth = MIN(labelWidth, viewWidth - kIASKMinValueWidth - kIASKPaddingLeft - kIASKSpacing -kIASKPaddingRight); | ||
CGRect labelFrame = self.textLabel.frame; | ||
labelFrame.origin.x = kIASKPaddingLeft; | ||
labelFrame.size.width = labelWidth; | ||
labelFrame.size.height -= 2; | ||
self.textLabel.frame = labelFrame; | ||
|
||
// set the right value label frame | ||
if (self.detailTextLabel.text.length) { | ||
CGRect valueFrame = self.detailTextLabel.frame; | ||
valueFrame.origin.x = kIASKPaddingLeft + labelWidth + kIASKSpacing; | ||
valueFrame.size.width = viewWidth - valueFrame.origin.x - kIASKPaddingRight; | ||
valueFrame.size.height -= 2; | ||
self.detailTextLabel.frame = valueFrame; | ||
} | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters