如何在已包含图像的按钮中添加文本。我尝试了各种方法,但文字不可见。如何使文本在图像顶部可见?
谁能帮帮我!
最佳答案
尝试设置按钮的backgroundImage
属性
[self.buttonWithTextAndImage setBackgroundImage:[UIImage imageNamed:@"image.png"] forState:UIControlStateNormal];
[self.buttonWithTextAndImage setTitle:@"Button Title" forState:UIControlStateNormal];
关于ios - UIButton 将文本设置在图像顶部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29225890/