2016-08-11 35 views
0

角落我有一個UITableCell它有一個ImageView的。我試圖給這個ImageView圓角。我試過以下內容:Xamarin.iOS怒斥的UITableViewCell的ImageView

cell.ImageView.ClipsToBounds = true; 
    cell.ImageView.Layer.BorderWidth = 1; 
    cell.ImageView.Layer.MasksToBounds = true; 
    cell.ImageView.Layer.CornerRadius = 20; 

但是這沒有效果。任何人都可以用代碼示例來解釋或演示如何實現這種效果?

回答

1

另一個問題啊,但它應該工作正常像你那樣,有一個截圖,所以才點哪裏出了問題的話,我可以幫你。

enter image description here

或者只是張貼詳細的代碼,你沒有,那麼我也許能發現問題。

+0

啊我想這個問題是因爲我已擴大的UITableViewCell,我已經加入了圓角代碼到我的自定義的UITableViewCell的構造和現在的作品! –

1
cell.ImageView.Layer.BorderWidth = 1; 
cell.ImageView.Layer.CornerRadius = 20; 
cell.ImageView.Layer.MasksToBounds = true; 

試着在最後掩飾邊界。

+0

嗨葉夫根尼·這是沒有效果的。圖像仍然呈現沒有圓角。 –

+0

請嘗試沒有'cell.ImageView.ClipsToBounds = TRUE;'的代碼行...只是評論它,然後再試一次。 –