0
使用此代碼我得到了我的個人資料圖片在正確的D形狀但在之後當我滾動tableView不是當我們進入視圖控制器。在滾動TableView之前無法在CellForRowAtIndexPath中應用UIBezierPath
UIBezierPath *maskPath;
maskPath = [UIBezierPath bezierPathWithRoundedRect:cellimg.boundsbyRoundingCorners:(UIRectCornerBottomRight|UIRectCornerTopRight)cornerRadii:CGSizeMake(40.0, 40.0)];
CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
maskLayer.frame =cellimg.bounds;
maskLayer.path = maskPath.CGPath;
cellimg.layer.mask = maskLayer;
'[yourTableView reloadData]'....在你的'viewDidLoad'方法中加入這一行。 –
請編輯問題標題 – Aleksey
嗨.. M Zubair Shamshad它不適合我。當我們滾動表格視圖時,靜態圖片仍然以d形狀顯示..個人資料圖片來自web Service。m在CellForRowAtIndex中編寫此代碼..任何其他的sol請務必... thanku – user6898211