this is an article about table view!!
MAKING table view GROUPED ::
tb = [[UITableView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame] style:UITableViewStyleGrouped];
************
UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0,0,320,440) style:UITableViewStyleGrouped];
tableView.rowHeight = 55;
[tableView setSectionHeaderHeight:5];
[tableView setSectionFooterHeight:5];
2. Setting with Delegate methods.
_______________________________________________________
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 25.0f;
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 25.0f;
}
Setting with properties
___________________________________________________________
UITableView *theTableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, 320, 440) style:UITableViewStyleGrouped];
theTableView.delegate = self;
theTableView.dataSource = self;
theTableView.backgroundColor=[UIColor brownColor];
UIImageView *img=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"flag_green(2).png"]];
img.frame=CGRectMake(5, 10, 5, 5);
[theTableView setTableHeaderView:img]
2. Setting with Delegate methods.
_______________________________________________________
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section // custom view for header. will be adjusted to default or specified header height
{
UIImageView *img=[[UIImageView alloc]initWithImage:myimageview];
img.frame=CGRectMake(5, 10, 10, 10);
return img;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section // custom view for footer. will be adjusted to default or specified footer height
{
UIImageView *img=[[UIImageView alloc]initWithImage:myimageview];
img.frame=CGRectMake(5, 10, 10, 10);
return img;
}
- pradeep T
- chennai, India
-
►
2012
(7)
- ► 03/04 - 03/11 (3)
- ► 01/08 - 01/15 (4)
-
▼
2009
(12)
- ► 02/15 - 02/22 (2)
-
►
2008
(2)
- ► 09/07 - 09/14 (1)
- ► 08/24 - 08/31 (1)
About Me
Blog Archive
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment