I had an application in which I am using a UIButton
with a title
and UIImage
. Their alignment
seems to be first title then after that the UIImage
.
I had tried this:
[dropdownbutton setImage: [UIImage imageNamed:@"down_sml_arrow.png"]
forState:UIControlStateNormal];
CGFloat spacing = 10; // the amount of spacing to appear between image and title
dropdownbutton.imageEdgeInsets = UIEdgeInsetsMake(0, 0, 0, spacing);
dropdownbutton.titleEdgeInsets = UIEdgeInsetsMake(0, spacing, 0, 0);
[dropdownbutton setTitle:@"Your text" forState:UIControlStateNormal];
but here the UIImage
is coming before the title. Can anybody point me in where I am going wrong?