簡體   English   中英

將UITableViewCell的UIImageVIew設置為不透明

[英]setting UIImageVIew of UITableViewCell as opaque

我在UITableViewCellStyleSubtitle上使用Core Animation和UIImageView進行的剖析顯示為混合(紅色),而不是不透明。

我正在像這樣設置圖像:

    // This is just a helper method that loads a .jpg from the disk
    UIImage *img = [Helpers getThumbnailImageIfExists:[obj valueForKey:@"PhotoName"] withManufacturer:self.client.ManufacturerID];
    cell.imageView.image = img;
   [cell.imageView setOpaque:YES];

我認為應該這樣做,但它仍然顯示為不透明。 我添加到contentView的某些UIButton遇到相同的問題

您的圖像可能包含一個Alpha通道。 即使將其設置為Opaque,iOS也會將其渲染為semi-transparent 嘗試通過Photoshop從圖像中刪除Alpha通道:

圖層>圖層背景

希望這可以幫助!

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM