iPhone开发 自定义uitabbar

1.换颜色

    CGRect frame = CGRectMake(0, 0, 320, 47);

UIView *v = [[UIView alloc] initWithFrame:frame];

UIColor *c = [[UIColoralloc] initWithRed:0.4green:0.7blue:0.3alpha:1.0];

    v.backgroundColor = c;

[tabBarController.tabBarinsertSubview:v atIndex:0];


2.换图片

UIImageView* image = [[UIImageViewalloc] initWithImage:[UIImageimageNamed:@"button.png"]];

image.frame = CGRectMake(0, 0, 320,49);

[tabBarController.tabBarinsertSubview:image atIndex:0];


posted @ 2012-03-06 15:44  凡娃软件  阅读(386)  评论(0编辑  收藏  举报