1

I am used a rounded image to create (in iPhone) a rounded button effect for cells in a UITableViewController.

Question - Is there a way I could programmatically change the background area of the rounded cell, which is basically the rounded UIImage I'm using? That is, without having the color spil outside the rounded edge area?

(i.e. currently the color is hard coded into the image effectively, would like to offer the ability for the user to be able to choose the color they want)

Greg
  • 34,042
  • 79
  • 253
  • 454
  • See http://stackoverflow.com/questions/6823493/how-to-use-a-uiimage-as-a-mask-over-a-color-in-objective-c/6823536#6823536 – Jano Sep 06 '11 at 10:14

2 Answers2

1

You can refer to OpenCV for the image processing and you can change the colors.

OpenCV.

I hope this helps you.

Parth Bhatt
  • 19,381
  • 28
  • 133
  • 216
  • 1
    hi Parth - do you happen to know then whether what I'm trying to do is possible without the use of third party libraries? i.e. by just sticking to the core IOS class libraries etc? – Greg Sep 06 '11 at 06:22
  • @Greg: Honestly speaking, I am not sure if this would be possible with core iOS libraries. :) – Parth Bhatt Sep 06 '11 at 08:00
1
Try this code its definitely help you.

CALayer *layer = [<yourimageview> layer];
[layer setMasksToBounds:YES];
[layer setCornerRadius:5.0];
Nikunj Jadav
  • 3,417
  • 7
  • 38
  • 54