我正在工作或項目中,我必須給角從左上角和右上角查看。我正在使用它的自動佈局。我的看法寬度爲296這裏是設計左右角的圓角不正確
按我在這裏的tableview我的代碼的圓角選擇視圖
let cell = tableView.dequeueReusableCellWithIdentifier("cell1", forIndexPath: indexPath)
let view_ = cell.viewWithTag(10)! as UIView
let maskLayer : CAShapeLayer = CAShapeLayer()
let maskpath = UIBezierPath(roundedRect: view_.bounds, byRoundingCorners: [.TopLeft,.TopRight], cornerRadii: CGSizeMake(10, 10))
maskLayer.frame = view_.bounds;
maskLayer.path = maskpath.CGPath;
view_.layer.mask = maskLayer
cell.selectionStyle = UITableViewCellSelectionStyle.None
return cell
但我的問題的第一個單元格設計是我得到這個輸出
我給view_.bounds
但我不知道爲什麼它需要該視圖的原始幀值。在像iphone 4s和5這樣的小型設備中,它可以完美輸出,但是在大設備中它會像screeshot一樣發生問題。
請幫我一下吧
剛剛刷新你的table in viewdidload()方法你的問題解決 –
定義tableCellView根據設備的屏幕寬度來看view.frame.width * 0.9 –
@MdIbrahimHassan我有同樣的問題,但底部的一面只有左側的工作。右側不顯示角落。我在工作目標c –