5/28/2009

Custom icon in UITableViewCell

Added icons by the items to indicate the item category such as weapons, armors, items, etc.
API made it really easy to do this.

アイテムの左側にアイテムジャンル(武器、防具など)を表示するアイコンを設置。ものすごく簡単にできる。

Inside this method in your UITableViewController:


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {


...put this:


UIImage *aIconImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"some_image" ofType:@"png"]];
cell.imageView.image = aIconImage;

No comments:

Post a Comment