UINavigationBar *bar = [[UINavigationBar alloc] initWithFrame:CGRectMake(0, 0, kDeviceWidth, 64)];
[bar setBackgroundImage:[UIImage imageNamed:@"blackbg"] forBarMetrics:UIBarMetricsDefault];
UINavigationItem *item = [[UINavigationItem alloc] init];
UIButton *backBarButton=[[UIButton alloc] initWithFrame:CGRectMake(0, 7, 30, 30)];
[backBarButton setBackgroundImage:[UIImage imageNamed:@"nav_back"] forState:UIControlStateNormal];
backBarButton.showsTouchWhenHighlighted=YES;
[backBarButton addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *backItem=[[UIBarButtonItem alloc] initWithCustomView:backBarButton];
item.leftBarButtonItem = backItem;
[bar pushNavigationItem:item animated:NO];
[self.view addSubview:bar];
UILabel * titleLabel=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 44)];
titleLabel.backgroundColor=[UIColor clearColor];
titleLabel.font=[UIFont systemFontOfSize:18];
[email protected]"Etcast";
titleLabel.textAlignment=NSTextAlignmentCenter;
titleLabel.textColor=[UIColor whiteColor];
item.titleView=titleLabel;