├── .DS_Store
├── showPic.gif
├── CustomTabBarProduct
├── .DS_Store
├── AWTabbar
│ ├── .DS_Store
│ ├── AWLineTabBarController.h
│ └── AWLineTabBarController.m
├── Assets.xcassets
│ ├── Contents.json
│ ├── tabbar_home.imageset
│ │ ├── tabbar_home@2x.png
│ │ ├── tabbar_home@3x.png
│ │ └── Contents.json
│ ├── tabbar_homeSelect.imageset
│ │ ├── tabbar_homeSelect@2x.png
│ │ ├── tabbar_homeSelect@3x.png
│ │ └── Contents.json
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── ViewController.h
├── AppDelegate.h
├── main.m
├── ViewController.m
├── Info.plist
├── Base.lproj
│ └── LaunchScreen.storyboard
└── AppDelegate.m
├── README.md
├── CustomTabBarProduct.xcodeproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── project.pbxproj
├── CustomTabBarProductTests
├── Info.plist
└── CustomTabBarProductTests.m
├── CustomTabBarProductUITests
├── Info.plist
└── CustomTabBarProductUITests.m
└── .gitignore
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/.DS_Store
--------------------------------------------------------------------------------
/showPic.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/showPic.gif
--------------------------------------------------------------------------------
/CustomTabBarProduct/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/.DS_Store
--------------------------------------------------------------------------------
/CustomTabBarProduct/AWTabbar/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/AWTabbar/.DS_Store
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # CustomTabbar
2 | 自定义底部导航--已适配iPad可以自行修改
3 | 技术qq群:637387838
4 |
5 | 效果图展示:
6 |
7 | 
8 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_home.imageset/tabbar_home@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/Assets.xcassets/tabbar_home.imageset/tabbar_home@2x.png
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_home.imageset/tabbar_home@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/Assets.xcassets/tabbar_home.imageset/tabbar_home@3x.png
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_homeSelect.imageset/tabbar_homeSelect@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/Assets.xcassets/tabbar_homeSelect.imageset/tabbar_homeSelect@2x.png
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_homeSelect.imageset/tabbar_homeSelect@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/ioswei/CustomTabbar/HEAD/CustomTabBarProduct/Assets.xcassets/tabbar_homeSelect.imageset/tabbar_homeSelect@3x.png
--------------------------------------------------------------------------------
/CustomTabBarProduct.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // CustomTabBarProduct
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/CustomTabBarProduct.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // CustomTabBarProduct
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/AWTabbar/AWLineTabBarController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AWLineTabBarController.h
3 | // PeoitXLoanProject
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface AWLineTabBarController : UITabBarController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // CustomTabBarProduct
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_home.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tabbar_home@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tabbar_home@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/tabbar_homeSelect.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "tabbar_homeSelect@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "tabbar_homeSelect@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/CustomTabBarProduct/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // CustomTabBarProduct
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view.
20 | self.view.backgroundColor = [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:arc4random()%255/255.0];
21 | }
22 |
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/CustomTabBarProductTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CustomTabBarProductUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/CustomTabBarProductTests/CustomTabBarProductTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CustomTabBarProductTests.m
3 | // CustomTabBarProductTests
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CustomTabBarProductTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CustomTabBarProductTests
16 |
17 | - (void)setUp {
18 | // Put setup code here. This method is called before the invocation of each test method in the class.
19 | }
20 |
21 | - (void)tearDown {
22 | // Put teardown code here. This method is called after the invocation of each test method in the class.
23 | }
24 |
25 | - (void)testExample {
26 | // This is an example of a functional test case.
27 | // Use XCTAssert and related functions to verify your tests produce the correct results.
28 | }
29 |
30 | - (void)testPerformanceExample {
31 | // This is an example of a performance test case.
32 | [self measureBlock:^{
33 | // Put the code you want to measure the time of here.
34 | }];
35 | }
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/CustomTabBarProductUITests/CustomTabBarProductUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // CustomTabBarProductUITests.m
3 | // CustomTabBarProductUITests
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface CustomTabBarProductUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation CustomTabBarProductUITests
16 |
17 | - (void)setUp {
18 | // Put setup code here. This method is called before the invocation of each test method in the class.
19 |
20 | // In UI tests it is usually best to stop immediately when a failure occurs.
21 | self.continueAfterFailure = NO;
22 |
23 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
24 | [[[XCUIApplication alloc] init] launch];
25 |
26 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
27 | }
28 |
29 | - (void)tearDown {
30 | // Put teardown code here. This method is called after the invocation of each test method in the class.
31 | }
32 |
33 | - (void)testExample {
34 | // Use recording to get started writing UI tests.
35 | // Use XCTAssert and related functions to verify your tests produce the correct results.
36 | }
37 |
38 | @end
39 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Xcode
2 | #
3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
4 |
5 | ## Build generated
6 | build/
7 | DerivedData/
8 |
9 | ## Various settings
10 | *.pbxuser
11 | !default.pbxuser
12 | *.mode1v3
13 | !default.mode1v3
14 | *.mode2v3
15 | !default.mode2v3
16 | *.perspectivev3
17 | !default.perspectivev3
18 | xcuserdata/
19 |
20 | ## Other
21 | *.moved-aside
22 | *.xccheckout
23 | *.xcscmblueprint
24 |
25 | ## Obj-C/Swift specific
26 | *.hmap
27 | *.ipa
28 | *.dSYM.zip
29 | *.dSYM
30 |
31 | # CocoaPods
32 | #
33 | # We recommend against adding the Pods directory to your .gitignore. However
34 | # you should judge for yourself, the pros and cons are mentioned at:
35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
36 | #
37 | # Pods/
38 |
39 | # Carthage
40 | #
41 | # Add this line if you want to avoid checking in source code from Carthage dependencies.
42 | # Carthage/Checkouts
43 |
44 | Carthage/Build
45 |
46 | # fastlane
47 | #
48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
49 | # screenshots whenever they are needed.
50 | # For more information about the recommended setup visit:
51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control
52 |
53 | fastlane/report.xml
54 | fastlane/Preview.html
55 | fastlane/screenshots/**/*.png
56 | fastlane/test_output
57 |
58 | # Code Injection
59 | #
60 | # After new code Injection tools there's a generated folder /iOSInjectionProject
61 | # https://github.com/johnno1962/injectionforxcode
62 |
63 | iOSInjectionProject/
64 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/CustomTabBarProduct/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // CustomTabBarProduct
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 | // QQ:71449265 QQ技术交流群:637387838
9 | //
10 | #import "AppDelegate.h"
11 | #import "AWLineTabBarController.h"
12 |
13 | @interface AppDelegate ()
14 |
15 | @end
16 |
17 | @implementation AppDelegate
18 |
19 |
20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
21 | // Override point for customization after application launch.
22 |
23 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
24 |
25 | self.window.rootViewController = [[AWLineTabBarController alloc] init];
26 |
27 | [self.window makeKeyAndVisible];
28 |
29 | return YES;
30 | }
31 |
32 |
33 | - (void)applicationWillResignActive:(UIApplication *)application {
34 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
35 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
36 | }
37 |
38 |
39 | - (void)applicationDidEnterBackground:(UIApplication *)application {
40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
42 | }
43 |
44 |
45 | - (void)applicationWillEnterForeground:(UIApplication *)application {
46 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
47 | }
48 |
49 |
50 | - (void)applicationDidBecomeActive:(UIApplication *)application {
51 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
52 | }
53 |
54 |
55 | - (void)applicationWillTerminate:(UIApplication *)application {
56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
57 | }
58 |
59 |
60 | @end
61 |
--------------------------------------------------------------------------------
/CustomTabBarProduct/AWTabbar/AWLineTabBarController.m:
--------------------------------------------------------------------------------
1 | //
2 | // AWLineTabBarController.m
3 | // PeoitXLoanProject
4 | //
5 | // Created by iMac-1 on 2019/4/26.
6 | // Copyright © 2019 iOS_阿玮. All rights reserved.
7 | //
8 |
9 | #import "AWLineTabBarController.h"
10 |
11 | #import "ViewController.h"
12 |
13 | #define BTN_HEIGHT 50
14 | #define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
15 | #define BTNTAG 10000
16 |
17 | @interface AWLineTabBarController ()
18 | {
19 | UIButton *_button;
20 | UIButton *_butTitle;
21 | UIView *_lineView;
22 | }
23 | @end
24 |
25 | @implementation AWLineTabBarController
26 |
27 | - (void)viewDidLoad {
28 | [super viewDidLoad];
29 | // Do any additional setup after loading the view.
30 |
31 | self.view.backgroundColor = [UIColor whiteColor];
32 |
33 | [self initControllers];
34 |
35 | [self creatTabbar];
36 |
37 | //去除顶部的分割线 -- 根据需求 自定注释
38 | // [[UITabBar appearance] setShadowImage:[UIImage new]];
39 | // [[UITabBar appearance] setBackgroundImage:[[UIImage alloc]init]];
40 |
41 | }
42 |
43 | #pragma mark - 如果想添加控制器到tabbar里面在这里面实例化就行
44 | - (void)initControllers
45 | {
46 | #pragma mark ————————————————主页
47 | ViewController *homeVC = [[ViewController alloc]init];
48 | UINavigationController *navVC1 = [[UINavigationController alloc]initWithRootViewController:homeVC];
49 | [navVC1 setNavigationBarHidden:YES];
50 |
51 | #pragma mark ————————————————我的
52 | ViewController *mineVC = [[ViewController alloc]init];
53 | UINavigationController *navVC2 = [[UINavigationController alloc]initWithRootViewController:mineVC];
54 | [navVC2 setNavigationBarHidden:YES];
55 |
56 | ViewController *uerVC = [[ViewController alloc]init];
57 | UINavigationController *navVC3 = [[UINavigationController alloc] initWithRootViewController:uerVC];
58 | [navVC3 setNavigationBarHidden:YES];
59 |
60 | ViewController *uer1VC = [[ViewController alloc]init];
61 | UINavigationController *navVC4 = [[UINavigationController alloc] initWithRootViewController:uer1VC];
62 | [navVC4 setNavigationBarHidden:YES];
63 |
64 | NSArray *ctrlArr = [NSArray arrayWithObjects:navVC1,navVC2,navVC3,navVC4,nil];
65 |
66 | self.viewControllers=ctrlArr;
67 | //照着上面添加控制球就行了
68 |
69 |
70 | }
71 |
72 | - (void)creatTabbar{
73 |
74 | NSArray *titleArrs = @[@"事件",@"程序猿",@"程序媛",@"工程师"];
75 | // 只需要该图片名字就行
76 | NSArray * normImage = @[@"tabbar_home",@"tabbar_home",@"tabbar_home",@"tabbar_home"];
77 | // 只需修改选中图片的名字
78 | NSArray * selectImage = @[@"tabbar_homeSelect",@"tabbar_homeSelect",@"tabbar_homeSelect",@"tabbar_homeSelect"];
79 | UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, self.tabBar.frame.size.height)];
80 | bgView.backgroundColor = [UIColor clearColor];
81 | bgView.userInteractionEnabled = YES;
82 |
83 | float btn_X = 0;
84 | float btn_width = SCREEN_WIDTH/self.viewControllers.count;
85 | if ([self getIsIpad]) {
86 | btn_X = 100;
87 | btn_width = (SCREEN_WIDTH-btn_X*2)/self.viewControllers.count;
88 | }
89 |
90 | for(int i = 0;i