Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RETextItem. Space between label and textField #115

Open
shmidt opened this issue Oct 26, 2013 · 14 comments
Open

RETextItem. Space between label and textField #115

shmidt opened this issue Oct 26, 2013 · 14 comments

Comments

@shmidt
Copy link
Contributor

shmidt commented Oct 26, 2013

Same amount of characters for the "Place of birth", written in different languages gives different result:

screen shot 2013-10-26 at 23 06 54
screen shot 2013-10-26 at 23 09 55

How can I fix English version?

@romaonthego
Copy link
Owner

Coukd you please post code that you're running?

@shmidt
Copy link
Contributor Author

shmidt commented Oct 27, 2013

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];
}

@romaonthego
Copy link
Owner

I can't reproduce it...
ios simulator screen shot oct 27 2013 11 48 15 am

@shmidt
Copy link
Contributor Author

shmidt commented Oct 27, 2013

Can't understand what is the reason...

@romaonthego
Copy link
Owner

There must be something else in your code that's causing it.

@romaonthego
Copy link
Owner

Did you figure it out? Was the problem in your code or there's a bug?

@shmidt
Copy link
Contributor Author

shmidt commented Nov 2, 2013

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...

@ericertl
Copy link

ericertl commented Nov 4, 2013

Can it be that sizeWithFont is using the default text in english instead of the localized text?

@shmidt
Copy link
Contributor Author

shmidt commented Nov 5, 2013

@ericertl Localized text is shown without any problems.

@shmidt
Copy link
Contributor Author

shmidt commented Nov 5, 2013

@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.

@shmidt
Copy link
Contributor Author

shmidt commented Dec 1, 2013

@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.
ios simulator screen shot 30 nov 2013 23 52 54
ios simulator screen shot 01 dec 2013 00 06 15

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.

@shmidt
Copy link
Contributor Author

shmidt commented Feb 16, 2014

And if I change text alignment to right, _birthPlace.textAlignment = NSTextAlignmentRight;
then textField and label swap places.
ios simulator screen shot 16 feb 2014 13 35 35

@pun777chy
Copy link

void (^onChange)(RETextItem *item)
can you please tell me what is the purpose of this? and how to define these properties???
Urgent help required.

@afshine
Copy link

afshine commented Jun 24, 2014

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants