Giter Club home page Giter Club logo

bctabbarcontroller's Introduction

BCTabBarController

BCTabBarController is a Tweetie-style tab bar for iPhone. See below for screenshots.

Why?

There are several problems with using the standard UITabBarController including:

  • It is too tall, especially in landscape mode
  • The height doesn't match the UIToolbar
  • It cannot be customized without using private APIs
  • It has labels. Sometimes you don't need labels.

BCTabBarController is completely written from scratch using public APIs to fix all of these problems and behaves almost identically to a normal UITabBarController.

Features

  • A cool little arrow that slides around to indicate the current tab
  • Support for all orientations
  • Same height as a standard UIToolbar

Usage

  • Add BCTabBarController.xcodeproj to your project by dragging it into the Groups & Files sidebar.
  • Select the added project file in the sidebar and then check the box next to libBCTabBarController.a
  • Select your project's target and right-click and choose "Get Info"
  • Click the + icon underneath Direct Dependencies and add the BCTabBarController target
  • libBCTabBarController.a should already be in the list of Linked Libraries
  • Drag BCTabBarController.bundle into your project's resources
  • If you haven't already, add the QuartzCore and Core Graphics frameworks to your project
  • Define the method - (NSString *)iconImageName in each view controller that you add to the tab bar. It should return the filename of the grey tab icon (see creation steps below)
  • See the example target for usage

Creating icons

Unlike UITabBarController, the tab bar icons in BCTabBars are have two pre-rendered states (four if you count the retina versions). You can use the provided tab.psd file to create those files.

  • Replace the layer masks in the PSD with the silhouette of the icon you wish to create
  • Save the grey layer as name.png and the blue layer as name-selected.png and add them to your project.

Screenshots

Acknowledgements

This controller wouldn't be possible without the original innovative design of Tweetie by Loren Brichter (atebits).

bctabbarcontroller's People

Contributors

afh avatar briancollins avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bctabbarcontroller's Issues

Crash BCTabbarcontroller in my project ?

Hi,
i m using bctabbarcontroller in my project i am follw the below link step to integerate

http://stackoverflow.com/questions/18375243/use-bctabbarcontroller-in-iphone-project

i Integaret successfully but when i click on second tab then it crash

Here is My Code 👎

AppDelegate .h

import <UIKit/UIKit.h>

@Class BCTabBarController;

@interface AppDelegate : UIResponder

{

}
@Property (nonatomic, retain) BCTabBarController *tabBarController;
@Property (strong, nonatomic) UIWindow *window;

@Property (strong, nonatomic) UINavigationController *navigationController;

@EnD

AppDeleagte .m

  • (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    {
    self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    // Override point for customization after application launch.

    self.tabBarController = [[BCTabBarController alloc] init];

    self.tabBarController.viewControllers = [NSArray arrayWithObjects:
    [[UINavigationController alloc]
    initWithRootViewController:[[ViewController1 alloc] init]],
    [[ViewController2 alloc] init],
    nil];

    [self.window addSubview:self.tabBarController.view];
    [self.window makeKeyAndVisible];

    return YES;
    }

main.m

import <UIKit/UIKit.h>

import "AppDelegate.h"

int main(int argc, char *argv[])
{
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}

Crash 👎

[__NSArrayM indexOfObject:]: message sent to deallocated

Thanks in Advance :)

iPad Support

Is it planned to support iPads?

On the iPad 2 with iOS 5.0.1 are several issues.

  • The white line is still there in landscape and portrait mode
  • landscape: tabbar only shows a subset of icons (the rest of the bar is black, but icons can be tapped and then show up)
  • landscape: the tabbar is placed too low
  • some more

ViewWillAppear and other methods not called

ViewWillAppear, ViewDidAppear, ViewWillDisappear ViewDidDisappear methods not called in selectded view controller and not called into BCTabBarController.
This problem appears after BCTabBarController show modal controller from instance of BCTabBarController class.

viewWillAppear, viewDidAppear getting called twice

At first I suspected it was the way my application was setup, but I created a test application using the EXViewController and generated the BCTabBarController in my app delegate, and I get viewWillAppear and viewDidAppear triggered twice.

Any thoughts?

Pb with iPhone5

I'm using this component and I have a black box between the tabbar (correctly set on the bottom) and the content view....
Is it a known pb ?

Tx for the support.

-Fred

Black screen when switching out UITabBarController with BCTabBarController

I switched out the standard UITabBarController with your's and I just get a blank screen. I'm starting to dig through the code but wondering if you have seen this before. For some reason in the "loadView" method I get null for the applicationFrame:

NSLog(@"[[UIScreen mainScreen] applicationFrame] = %@", [[UIScreen mainScreen] applicationFrame]);
// prints null
NSLog(@"[[UIScreen mainScreen] applicationFrame].size.width = %d", [[UIScreen mainScreen] applicationFrame].size.width);
// prints 0

Icons don't show up when UIViewController is placed inside UINavController

I tried implementing the tab bar in my project, which contains Nav controllers with UIViewControllers just like the example, however the icons don't appear. If I try with just the UIViewController it works. In my project I try to recreate the example, and I even use the EXViewController class. The issue could be that I started the project as a Windows Based Application? That's the only difference I can discern.

Not hiding when presentViewController:animated:completion: is called

I was playing around with BCTabBarController I I noticed the tabbar is not hidden when I present another viewcontroller modally. The standard behaviour of UITabBarController seems to be that the TabBar is hidden.

Is this a known issue? I don't know if it's related to the hidesBottomBarWhenPushed issue?

There is lexical or preprocessor issue, 'BCTabBarController.h' file not found.

I've done all steps in Usage section except the second step, because I did not see any box to be checked.
As written in http://www.section42.de/2011/04/12/bctabbarcontroller-and-xcode-4/ , I should see the entry “libBCTabBarController.a” in the left pane of XCode.
But now I can't find the entry “libBCTabBarController.a” in there.

As the result, I can't do
#import "BCTabBarController.h"
in my delegate.m file. There is lexical or preprocessor issue, 'BCTabBarController.h' file not found.
But I can do
@Class BCTabBarController;
from my delegate.h file

Did I miss something?

Usage

Add BCTabBarController.xcodeproj to your project by dragging it into the Groups & Files sidebar.
Select the added project file in the sidebar and then check the box next to libBCTabBarController.a
Select your project's target and right-click and choose "Get Info"
Click the + icon underneath Direct Dependencies and add the BCTabBarController target
libBCTabBarController.a should already be in the list of Linked Libraries
Drag BCTabBarController.bundle into your project's resources
If you haven't already, add the QuartzCore and Core Graphics frameworks to your project
Define the method - (NSString *)iconImageName in each view controller that you add to the tab bar. It should return the filename of the grey tab icon (see creation steps below)
See the example target for usage

Adding a title and image

Hi,

When I try to add a title to the tab bar, it is formatted incorrectly. The text cannot fit and its to the side, I want it to be below the icon

hidesBottomBarWhenPushed is invalid

If one tab bar uses navigationController, the self.hidesBottomBarWhenPushed is invalid when I push a new view controller.
In fact I need to hide the tab bar when I push a new view controller.

Precompiler error - pch file not found error when Archiving for Distribution

Hi,

I am getting following error where I am archiving for distribution only.
Its working fine on simulator and even on device with Developer Profile.
I followed the example as provided ... not sure what am I missing here?

Compiler Error -

ProcessPCH /Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/Build/PrecompiledHeaders/BCTabBarController_Prefix-gcyegysplhlyxzcibemetstodnez/BCTabBarController_Prefix.pch.pth BCTabBarController_Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/dk/Projects/2012_01_05_Walking_Cycling/Code/2012_2_23_Part2_Cycling
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -x objective-c-header -arch armv7 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=gnu99 -Wno-trigraphs -fpascal-strings -Os -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -isysroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -gdwarf-2 -Wno-sign-conversion -mthumb "-DIBOutlet=attribute((iboutlet))" "-DIBOutletCollection(ClassName)=attribute((iboutletcollection(ClassName)))" "-DIBAction=void)attribute((ibaction)" -miphoneos-version-min=3.2 -iquote /Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/BCTabBarController-generated-files.hmap -I/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/BCTabBarController-own-target-headers.hmap -I/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/BCTabBarController-all-target-headers.hmap -iquote /Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/BCTabBarController-project-headers.hmap -I/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/BuildProductsPath/Release-iphoneos/include -Isrc -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2/libxml -I/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/DerivedSources/armv7 -I/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/IntermediateBuildFilesPath/Cycling.build/Release-iphoneos/BCTabBarController.build/DerivedSources -F/Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/ArchiveIntermediates/Cycling/BuildProductsPath/Release-iphoneos -c /Users/dk/Projects/2012_01_05_Walking_Cycling/Code/2012_2_23_Part2_Cycling/BCTabBarController_Prefix.pch -o /Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/Build/PrecompiledHeaders/BCTabBarController_Prefix-gcyegysplhlyxzcibemetstodnez/BCTabBarController_Prefix.pch.pth -MMD -MT dependencies -MF /Users/dk/Library/Developer/Xcode/DerivedData/Cycling-fsnjilzfxsihaqgbynhlsabjftfr/Build/PrecompiledHeaders/BCTabBarController_Prefix-gcyegysplhlyxzcibemetstodnez/BCTabBarController_Prefix.pch.d

clang: error: no such file or directory: '/Users/dk/Projects/2012_01_05_Walking_Cycling/Code/2012_2_23_Part2_Cycling/BCTabBarController_Prefix.pch'
clang: error: no input files
Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/clang failed with exit code 1

Blurry icons

I'm trying to implement the tab bar but some, not all, of the icons I make come out blurry. I though it was just me. I don't know what is causing it. I'm using the same icon for all my tab bar items just as a test. So, it's the same image but blurry in different tab bar items.

Long tap popup items

Hi there,

thanks for the great tabbar controller! Would it be possible to add something like the popup item feature of Tweetbot to it? Like when you press a tabbar item it pops up more items?

If this isn't something you want to do, can you point me in the right direction how to best do it?

Thanks again,
Shukuyen.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.