回答
設置視圖的角Radius並在其下面插入標籤。
iPhone支持CALayer類的cornerRadius屬性。每個視圖都有一個可以操作的CALayer實例。
所有#import <QuartzCore/QuartzCore.h>
並鏈接到QuartzCore framework
首先以訪問的CALayer的頭和properties.Then,
yourView.layer.cornerRadius = 8;
我們如何設置th e角半徑?如果你有空閒時間,你能舉個例子嗎?感謝Advances。 – Sovannarith
我已經添加了代碼。它只是一行代碼,你需要包含一個使用它的框架 –
現在它可以工作。非常感謝你。 – Sovannarith
您可以通過
yourview.layer.cornerRadius = 8.0; // or other value
使用此代碼,使圓邊
UIButton *bt = [UIButton buttonWithType:UIButtonTypeCustom];
[bt setFrame:CGRectMake(10, 10, 50, 50)];
[bt setImage:[UIImage imageNamed:@"abc.png" ] forState:UIControlStateNormal];
// Get the Layer of any view
CALayer * l = [bt layer];
[l setMasksToBounds:YES];
[l setCornerRadius:10.0];
// You can even add a border
[l setBorderWidth:4.0];
[l setBorderColor:[[UIColor blueColor] CGColor]];
[self.view addSubview:bt];
- 1. 如何創建一個像iPhone主屏幕的圖標網格?
- 2. iphone,自動添加主屏幕圖標
- 3. 定製Android主屏幕上的圖標
- 4. SDL使用多個視口的屏幕座標在屏幕上繪製圖像
- 5. 主屏幕圖標
- 6. 如何在屏幕上繪製圖像?
- 7. iPhone全屏幕圖像
- 8. 試圖使用pygame在屏幕上繪製圖像,但屏幕是空白的?
- 9. Iphone的高清屏幕沒有映射到繪圖座標
- 10. 主屏幕上的項目名稱欄
- 11. 主屏幕圖標列表
- 12. 在iPhone屏幕上的視圖中繪製點?
- 13. iPhone繪圖到屏幕問題
- 14. iPhone:用於主屏幕和App Store的不同圖標
- 15. 使用主屏幕圖標打破iPhone上的設備高度
- 16. iPhone主屏幕上的圖標看起來奇怪
- 17. 目標c:在屏幕上繪製PNG(在UIImageView裏面的UIImage)
- 18. 繪製到屏幕
- 19. 在主屏幕上使用後臺服務繪製位圖圖像
- 20. 主屏幕圖標的位置
- 21. Android |主屏幕上的書籤圖標
- 22. 在屏幕上的(0,0)處繪製圖像在左下角繪製
- 23. 如何繪製屏幕像素
- 24. 繪製像素到屏幕,跨平臺
- 25. 如何繪製HTML中圖像上項目的x,y座標
- 26. 放在哪裏繪製的圖像爲特定屏幕大小
- 27. R:繪製屏幕內的光柵圖像()不工作
- 28. 在nds的子屏幕上繪製圖像
- 29. 繪製的圖像不保留在屏幕上
- 30. 繪製到離屏圖像
thnx在這裏是你的 –