如何在 UIButton 之上添加 UIButton?
这样一来,如果我移动父 UIButton,顶部的 UIButton 也会移动。
最佳答案
UIButton *testButton = [UIButton buttonWithType:UIButtonTypeCustom];
testButton.backgroundColor = [UIColor redColor];
UIButton *smallerButton = [UIButton buttonWithType:UIButtonTypeCustom];
smallerButton.backgroundColor = [UIColor greenColor];
[testButton addSubview:smallerButton];
[self.view addSubview:testButton];
关于iphone - 如何将 UIButton 添加到 UIButton,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13878980/