RETableViewManager
RETableViewManager copied to clipboard
RETextItem. Space between label and textField
Same amount of characters for the "Place of birth", written in different languages gives different result:

How can I fix English version?
Coukd you please post code that you're running?
RETableViewSection *birthSection = [RETableViewSection sectionWithHeaderTitle:NSLocalizedString(@"Birth", nil)];
[_manager addSection:birthSection];
REDateTimeItem *dateOfBirth = [REDateTimeItem itemWithTitle:NSLocalizedString(@"Birth date", nil) value:_person.dateOfBirth placeholder:@"-" format:@"MMM d, y" datePickerMode:UIDatePickerModeDate];
dateOfBirth.onChange = ^(REDateTimeItem *item){
weakSelf.person.dateOfBirth = item.value;
[weakSelf.managedObjectContext save:nil];
};
[birthSection addItem:dateOfBirth];
RETextItem *birthPlace = [RETextItem itemWithTitle:NSLocalizedString(@"Place of Birth", nil) value:_person.placeOfBirth placeholder:NSLocalizedString(@"-", nil)];
birthPlace.clearButtonMode = UITextFieldViewModeWhileEditing;
birthPlace.autocapitalizationType = UITextAutocapitalizationTypeWords;
birthPlace.textAlignment = NSTextAlignmentLeft;
birthPlace.onEndEditing = ^(RETextItem *item){
weakSelf.person.placeOfBirth = item.value;
[weakSelf.managedObjectContext save:nil];
};
[birthSection addItem:birthPlace];
#pragma mark Styling
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
cell.textLabel.textColor = [UIColor colorWithRed:0.091 green:0.561 blue:0.989 alpha:1.000];
cell.textLabel.font = [UIFont systemFontOfSize:14];
}
I can't reproduce it...

Can't understand what is the reason...
There must be something else in your code that's causing it.
Did you figure it out? Was the problem in your code or there's a bug?
No, not yet. I'm pretty sure that there is no problem with my code, however I have suspicion that this problem somehow connected with localisation...
Can it be that sizeWithFont is using the default text in english instead of the localized text?
@ericertl Localized text is shown without any problems.
@romaonthego I can send you the project via Dropbox, so you can check for yourself. I don't have any ideas why is this happens.
@romaonthego That's weird, but I still can't figure it out what is wrong.
If I place this item closer to the beginning or to the end of the table, spacing become even less.
Also, scrolling has some gap at the bottom of the table view.

P.S.: I don't have any scroll view delegate methods. My first suspicion was on the collection view, which is used as table header view, but I even removed it and got the same results.
And if I change text alignment to right, _birthPlace.textAlignment = NSTextAlignmentRight;
then textField and label swap places.

void (^onChange)(RETextItem *item) can you please tell me what is the purpose of this? and how to define these properties??? Urgent help required.
I can't right align the value of item. If I use item.textAlignment, it exactly does what shmidt said. How do you right align the value of the item keeping the title left aligned? Is there a way to do that?