Yevgeni Yevgeni - 10 months ago 24
Objective-C Question

Title shows 3 dots "..." instead of the string in a toggle button

Strange behaviour. Im trying to make toggle button that changes the title of the button.
But instead of "Done" it shows me "..." :

enter image description here

The method:

[sender setTitle:@"Edit" forState:UIControlStateNormal];

[self setEditing:NO animated:YES];
else if(!self.isEditing){
[sender setTitle: @"Done" forState:UIControlStateNormal];

[self setEditing:YES animated:YES];


It's truncating, either button needs to be bigger, or text needs to be smaller.

To adjust text dynamically,

yourButton.titleLabel.adjustsFontSizeToFitWidth = YES;
yourButton.titleLabel.minimumScaleFactor = 0.5;