Skip to content

Instantly share code, notes, and snippets.

@drudge
Created June 13, 2011 22:24
Show Gist options
  • Save drudge/1023879 to your computer and use it in GitHub Desktop.
Save drudge/1023879 to your computer and use it in GitHub Desktop.
Better style for IBAForms
#import <Foundation/Foundation.h>
#import "IBAFormFieldStyle.h"
// Form field label style
#define TWFormFieldLabelX 13
#define TWFormFieldLabelY 6
#define TWFormFieldLabelWidth 80
#define TWFormFieldLabelHeight 30
// Form field value style
#define TWFormFieldValueX 80
#define TWFormFieldValueY 12
#define TWFormFieldValueWidth 235
#define TWFormFieldValueHeight 26
@interface TWFormFieldStyle : IBAFormFieldStyle
@end
#import "TWFormFieldStyle.h"
@implementation TWFormFieldStyle
- (id)init
{
if (self = [super init]) {
self.labelTextColor = [UIColor colorWithRed:0.318 green:0.400 blue:0.569 alpha:1.0];
self.labelFont = [UIFont boldSystemFontOfSize:12];
self.valueFont = [UIFont boldSystemFontOfSize:14];
self.labelFrame = CGRectMake(TWFormFieldLabelX, TWFormFieldLabelY, TWFormFieldLabelWidth, TWFormFieldLabelHeight);
self.valueFrame = CGRectMake(TWFormFieldValueX, TWFormFieldValueY, TWFormFieldValueWidth, TWFormFieldValueHeight);
self.labelAutoresizingMask = UIViewAutoresizingFlexibleWidth;
self.valueAutoresizingMask = UIViewAutoresizingFlexibleWidth;
}
return self;
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment