修改UITabBar的背景圖片

1.

    UIImageView *tabBarBgView = [[UIImageView alloc] initWithFrame:_tabBarController.view.bounds];
    [tabBarBgView setImage:[UIImage imageNamed:@"menu_bar.png"]];
    [tabBarBgView setContentMode:UIViewContentModeScaleToFill];
    [_tabBarController.tabBar insertSubview:tabBarBgView atIndex:1];
    [tabBarBgView release];

2.

    UIView *tabBarBgView = [[UIView alloc] initWithFrame:_tabBarController.view.bounds];
    tabBarBgView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"menu_bar.png"]];
    [_tabBarController.tabBar insertSubview:tabBarBgView atIndex:1];
    [tabBarBgView release];

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章