Sometimes you need to debug location of objects. This can be difficult, when those objects are transparent or have same color as the background.
Showing posts with label CGColor. Show all posts
Showing posts with label CGColor. Show all posts
Wednesday, May 11, 2011
Visual UI Debugging
Labels:
CGColor,
debug,
NSLog,
NSStringFromCGRect,
UIColor
Wednesday, October 20, 2010
How to Make Round Corners for UITableViewCell
Sometimes you need round border around one or more UITableViewCell. Or maybe a button look-a-like without going through the trouble of actually making one. Here's a quick way:
First of all, you MUST include QuartzCore header, else meet some interesting error notes:
For example I replaced this (got a bit further with carefully positioned UIViews inside UITableViewCell) with hardcoded bitmaps and scaling them nicely.
First of all, you MUST include QuartzCore header, else meet some interesting error notes:
#import <QuartzCore/QuartzCore.h>Then add this code after your cell initialization routine, usually at cellForRowAtIndexPath:
CALayer *layer = cell.layer;Like many things in iOS SDK, you get to a certain point with relative ease - and this is about it. If you want to have more control over your "bubble button" you either dig deep into Quartz sample code or implement something which looks same in a completely different way.
layer.borderColor = [[UIColor blueColor] CGColor];
layer.borderWidth = 3.0f;
layer.cornerRadius = 20.0f;
For example I replaced this (got a bit further with carefully positioned UIViews inside UITableViewCell) with hardcoded bitmaps and scaling them nicely.
Subscribe to:
Posts (Atom)
