我有一个应用程序,我在其中使用UIButton
atitle
和UIImage
。他们alignment
似乎是第一个标题,然后是UIImage
.
我试过这个:
[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];
但这里UIImage
是在标题之前。谁能指出我哪里出错了?