Revision 54cb751a Classes/EditPolicyViewController.m

b/Classes/EditPolicyViewController.m
171 171
        }
172 172
    }
173 173
    else if (indexPath.section == kQuota) {
174
        CGRect bounds = [cell.contentView bounds];
175
        CGRect rect = CGRectInset(bounds, 20.0, 10.0);                        
176
        UITextField *textField = [[UITextField alloc] initWithFrame:rect];
177
        [textField setFrame:rect];
174
        UITextField *textField = nil;
175
        for (id subView in cell.contentView.subviews) {
176
            if ([subView isKindOfClass:[UITextField class]]) {
177
                textField = (UITextField *)subView;
178
            }
179
        }
180
        
181
        if (textField == nil) {
182
            CGRect bounds = [cell.contentView bounds];
183
            CGRect rect = CGRectInset(bounds, 20.0, 10.0);                        
184
            textField = [[UITextField alloc] initWithFrame:rect];
185
            [textField setFrame:rect];
186
        }
178 187
        [textField setClearButtonMode:UITextFieldViewModeWhileEditing];
179 188
        [textField setBackgroundColor:[UIColor clearColor]];
180 189
        [textField setOpaque:YES];
181 190
        [textField setAutocorrectionType:UITextAutocorrectionTypeNo];
182 191
        [textField setAutocapitalizationType:UITextAutocapitalizationTypeNone];
183 192
        [textField setDelegate:self];
193
        textField.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
184 194
        
185 195
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
186 196
        textField.text = [NSString stringWithFormat:@"%u", container.quota];
......
212 222

  
213 223
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
214 224
{
225
    if (indexPath.section != kQuota)
226
        [self.view endEditing:YES];
227

  
215 228
    if (indexPath.section == kVersioning) {
216 229
        if (indexPath.row == 0) {
217 230
            if (!autoVersioning) {

Also available in: Unified diff