I wish to align title and image in UiButton in such a manner that the title appears on the left and the image to the extreme right. Please note that the button is stretched so as to fill the screen horizontally.
The button layout should look something like this:- [title .. ]
The title should have some left padding. The image should have some right padding.
CGFloat width = self.frame.size.width;
CGFloat imageWidth = [button currentImage].size.width;
button.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
[button setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0)];
[button setImageEdgeInsets:UIEdgeInsetsMake(0, width - imageWidth - 10, 0, 0)];
However, though the title is left align, there is a lot of space on it's left. The image does not show up at all!


因此它将始终保持在最左侧
因此它将始终保持在最右侧