Monday 24 September 2012

Create UITableViewCell Shadow

How to Create UITableViewCell Shadow :-

The following code helps you to create a UITableViewCell Shadow on the rightside


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if (cell == nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
NSLog(@"new cell");

UIView *shadowView = [[UIView alloc] initWithFrame:CGRectMake(320, 0, 10, 44)];
shadowView.layer.shadowColor = [UIColor darkGrayColor].CGColor;
shadowView.layer.shadowRadius = 5.0;
shadowView.layer.shadowOffset = CGSizeMake(-2, 0);
shadowView.layer.shadowOpacity = 0.8;
shadowView.backgroundColor = [UIColor darkGrayColor];
shadowView.tag = 100;

shadowView.autoresizingMask = UIViewAutoresizingFlexibleHeight;

[cell addSubview:shadowView];

}
else
{
NSLog(@"old cell");
}

return cell;
}

4 comments:

  1. iPhone APP Development Company is appreciating your writing efforts on curating this article.

    ReplyDelete
  2. Codevian Technologies is a professional PHP development company. We provide our services and best results to our customers. We bring great websites and web application of every size to our clients. We transform your dream projects into reality. Codevian Technologies is the right place to hire php developers. Please feel free to call us on +91 9225108952 or contact by email at sales@codevian.com, if you require any additional information. Please visit our website www.codevian.com.com

    ReplyDelete
  3. Wow, What a Excellent post. I really found this to much informatics. It is what i was searching for.I would like to suggest you that please keep sharing such type of info.Visit here for Penetration testing services and Software testing services

    ReplyDelete