0
A
回答
2
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];
0
[oneButton addSubview:otherButton];
记住UIButton
是UIView
一个子类...
0
UIButton *parentBtn;
UIButton *childBtn;
parentBtn = [UIButton buttonWithType: // init the button];
childBtn = //same for child btn
[self.view addSubview:parentBtn]; //add the parent button to the view
[parentBtn addSubview:childBtn]; //add the child button on top of the parent button
相关问题
- 1. 将UIButton添加到SKScene
- 2. 将插座添加到UIButton
- 3. 将UIImageView添加到UIButton
- 4. 如何将观察者添加到UIButton?
- 5. 如何将属性添加到UIButton?
- 6. 如何将3Dtouchforce添加到UIButton?
- 7. 如何将阴影添加到UIButton?
- 8. 添加UIButton到AVCaptureVideoPreviewLayer?
- 9. iphone sdk:如何将事件添加到UIButton UIWebView中添加
- 10. 将UIButton添加到数组中
- 11. 将图像添加到UINavigationBar中的UIButton
- 12. 将静态UIButton添加到UIScrollview中
- 13. ABTableViewCell - 添加UIButton
- 14. 如何添加一帧到UIButton
- 15. 如何添加一个动作到UIButton
- 16. 如何添加一个UIButton到MKAnnotation(MKView)?
- 17. 如何动态添加UIButton到UITableViewCell?
- 18. 如何CAGradientLayer添加到UIButton的
- 19. 添加UIButton到UItableview单元
- 20. 添加的UIButton到UITabBar
- 21. 添加到UIButton的UITableView
- 22. 将工具提示添加到UIbutton
- 23. 将选择器添加到UIButton
- 24. 将UIButton添加到UICollectionView标题
- 25. 点击时将图片添加到UIButton
- 26. 将UIButton添加到子视图
- 27. 将uibutton添加到navigationController标题栏iphone
- 28. 将UIButton添加到AdWhirl广告横幅
- 29. 如何在Swift 3中将UIButton添加到我的UITableViewCell中?
- 30. 将UIButton添加到UIScrollView,然后将UIScrollView添加到UIView
emmmm .....什么???? – Stas
也许Autolayout是你在找什么。 –