Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mikezang

macrumors 6502a
Original poster
May 22, 2010
939
41
Tokyo, Japan
I have a UIImageView on UIView, I use code as below to draw round corner, but it doesn't work, what can I do?
Code:
    self.icon.image = [UIImage imageNamed:@"icon-72.png"];
    self.icon.layer.masksToBounds = YES;
    self.icon.layer.cornerRadius = 10.632f;
 
What is self?
What is icon?
I found reason, that doesn't show round corner in Simulator, but show it on my iPhone4S, is this a bug about Simulator?
 

Attachments

  • simulator.png
    simulator.png
    23 KB · Views: 88
  • iphone4s.png
    iphone4s.png
    33.8 KB · Views: 250
I wouldn't consider a bug so much as just a shortcoming of the simulator... the simulator can't run the exact same binary as the iPhone because the CPU in Mac is different from that of an iOS device. To do final software tests, always do it on an actual iOS device, not the simulator.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.