Skip to content
This repository has been archived by the owner on Jul 25, 2019. It is now read-only.

Commit

Permalink
Fix cosmetic issue with custom fields on iPad
Browse files Browse the repository at this point in the history
  • Loading branch information
austintaylor committed May 3, 2012
1 parent f32e217 commit 4d1757a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## master ##

* Remove sign out button if the user is signed in programmatically
* Fix a cosmetic issue with custom fields on the iPad

## 1.1.0 ##

Expand Down
10 changes: 7 additions & 3 deletions Classes/UVNewTicketViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -177,21 +177,25 @@ - (void)initCellForText:(UITableViewCell *)cell indexPath:(NSIndexPath *)indexPa
}

- (void)initCellForCustomField:(UITableViewCell *)cell indexPath:(NSIndexPath *)indexPath {
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(16, 0, cell.frame.size.width / 2 - 20, cell.frame.size.height)] autorelease];
BOOL iPad = UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad;
UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(iPad ? 60 : 16, 0, cell.frame.size.width / 2 - 20, cell.frame.size.height)] autorelease];
label.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleRightMargin;
label.font = [UIFont boldSystemFontOfSize:16];
label.tag = UV_CUSTOM_FIELD_CELL_LABEL_TAG;
label.textColor = [UIColor blackColor];
label.backgroundColor = [UIColor clearColor];
label.adjustsFontSizeToFitWidth = YES;
[cell addSubview:label];

UITextField *textField = [[[UITextField alloc] initWithFrame:CGRectMake(cell.frame.size.width / 2 + 10, 10, cell.frame.size.width / 2 - 20, cell.frame.size.height - 10)] autorelease];
UITextField *textField = [[[UITextField alloc] initWithFrame:CGRectMake(cell.frame.size.width / 2 + 10, 10, cell.frame.size.width / 2 - (iPad ? 64 : 20), cell.frame.size.height - 10)] autorelease];
textField.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin;
textField.borderStyle = UITextBorderStyleNone;
textField.tag = UV_CUSTOM_FIELD_CELL_TEXT_FIELD_TAG;
textField.delegate = self;
[cell addSubview:textField];

UILabel *valueLabel = [[[UILabel alloc] initWithFrame:CGRectMake(cell.frame.size.width / 2 + 10, 4, cell.frame.size.width / 2 - 20, cell.frame.size.height - 10)] autorelease];
UILabel *valueLabel = [[[UILabel alloc] initWithFrame:CGRectMake(cell.frame.size.width / 2 + 10, 4, cell.frame.size.width / 2 - (iPad ? 64 : 20), cell.frame.size.height - 10)] autorelease];
valueLabel.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleLeftMargin;
valueLabel.font = [UIFont systemFontOfSize:16];
valueLabel.tag = UV_CUSTOM_FIELD_CELL_VALUE_LABEL_TAG;
valueLabel.textColor = [UIColor blackColor];
Expand Down

0 comments on commit 4d1757a

Please sign in to comment.