如何以编程方式将按钮标题叠加到按钮图像的顶部,并将它们放置在按钮框架中彼此重叠的死点位置?
let button = UIButton()
button.setImage(coolpic, for .normal)
button.contentMode = .center
button.setTitle("tap me", for: .normal)
// a bunch of constraints and styling that define the frame
是否必须将图像设置为背景图像?我是否需要创建一个UILabel作为按钮标题,并将其添加为按钮的子视图?
谢
当我的应用程序进入后台时,我的模式显示视图控制器就会取消这样的警告视图。
// called when view controller receives a UIApplicationDidEnterBackgroundNotification
- (void)applicationDidEnterBackground:(NSNotification *)notification
{
if (self.alertView) {
[self.alertView dismissWithClickedButtonIndex:0 animated:NO];
se