Yevgeni Yevgeni -5 years ago 119
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];

Answer Source

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;
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download