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是你在找什麼。 –