Giter Site home page Giter Site logo

fsverticaltabbarcontroller's Introduction

Overview

This project aims to replicate UITabBarController functionality and behavior, but with a vertical tab bar.

There's no controller for customizing the tab bar in runtime (aka "More" tab), instead the tab bar can accommodate an "infinite" number of tabs because it's a UITableView under the hood (but the scrolling is automatically turned off if it's not necessary).

While some may find it production ready there's still many things that can be added/improved/(fixed), thus all contributions are welcomed. Here's a sneak peek at how it looks like with 120px with tab bar and a textured image as background.

Currently includes a sample Universal project that will run on iPad and iPhone. Basic usage is as follows:

FSVerticalTabBarController * tc = [[FSVerticalTabBarController alloc] init];
//Create the first view controller
FSViewController * vc = [[FSViewController alloc] init];
//Create tabItem for the view controller
vc.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"tab 1" image:[UIImage imageNamed:@"magnifying-glass.png"] tag:0];
//create another view controller
FSViewController * vc1 = [[FSViewController alloc] init];
//change background color of second view to differentiate
[vc1.view setBackgroundColor:[UIColor blueColor]];
vc1.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"tab 2" image:[UIImage imageNamed:@"magnifying-glass.png"] tag:1];
//set the view controllers of the the tab bar controller
[tc setViewControllers:[NSArray arrayWithObjects:vc,vc1, nil]];
//set one view controller to be selected
[tc setSelectedViewController:vc];
//set the background color to a texture
[[tc tabBar] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"ios-linen.png"]]];
//now add the TabBarController to the window as the root controller
[[self window] setRootViewController:tc];
[[self window] makeKeyAndVisible];

Requirements:

  • iOS5 or above
  • Automatic Reference Counting

TODO:

  • add tab bar gradient drawing (currently one can only use images)
  • add more delegate methods
  • add (better) sample code
  • test it with Interface Builder (do we need it? :)
  • probably many other

fsverticaltabbarcontroller's People

Contributors

bejo avatar ecaselles avatar greggs avatar jstart avatar m1entus avatar macbuildserver avatar moriquendi avatar nelanelanela 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  avatar  avatar  avatar  avatar

fsverticaltabbarcontroller's Issues

Tab Bar Gradient Drawing

Per the initial README by Future Simple, it would be great to enable gradient backgrounds on the tab bar. Setting up this issue to track discussion regarding the milestone of adding this feature.

Change the height for a cell

I added a different image than the selectionindicator image thats provided in each of the tableview cells. However the image gets cropped from the top. I tried adjusting the tabbarbutton class but that doesnt work. Does anyone know how to increate the height or the cell? The usual method rowheight doesnt work. Or any way in which i can display the full image. Thanks

ViewController never gets removed

setSelectedIndex is broken, the variable selectedIndex is defined as unsigned integer, but you actually assign it -1 and assume it is a signed integer.

e.g. line 95: if (-1 < _selectedIndex && _selectedIndex < INT_MAX)
is never true as -1 gets converted to an unsigned type and is bigger than the selectedIndex

I suggest converting selectedIndex to a NSInteger. this requires that lines like 82 are change to:

if (selectedIndex != _selectedIndex && selectedIndex < (int)[self.viewControllers count])

eg. an additional (int) cast is required

Images not showing in iOS 7

I know it is still in development, but I wanted to mention that the images are not showing in the iOS 7 simulator. Titles are showing normally.

iOS FSVerticalTabBarController glitchy when selecting tabBar items

Basically, pressing a tabitem does not select it. It only selects it when I keep hold on my touch on that item. Weird enough everything is working perfect on your sample project but not when integrated with other project. I've already used your basic usage docu and I even duplicated your examplecontroller but still no luck.

Can you atleast look at this. thanks

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.