user3762713
user3762713

Reputation: 101

How to fetch Background colour of the UIImageView

I am developing one iPad application using story board. In my application I have one UITableView and one UICollectionView. In UICollectionView the UICollectionViewCell contains one UIImage and UIButton. I am setting backgroundColor for the UIImageView using code based on the color coming from web api. I need to fetch the back ground color of the UIImageView. When I click the UIButton in the coresponding cell.

My question is: Is it possible to fetch the background color of the UIImageView?

Upvotes: 0

Views: 91

Answers (2)

jithinroy
jithinroy

Reputation: 1885

Use backgroundColor property of the UIImageView to get the color.

Upvotes: 1

Geet
Geet

Reputation: 2437

I am not sure, but you can do something like:

UIColor *clr=self.imageView.backgroundColor;

It will return a colour. try using it.

Upvotes: 2

Related Questions