GithubHelp home page GithubHelp logo

honood / jmtabview Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jasonmorrissey/jmtabview

1.0 2.0 0.0 127 KB

Stylish and animated tab view for iOS rendered entirely using core graphics.

License: Other

jmtabview's Introduction

JMTabView

This is a dark-themed and easy to use tab view created entirely using Core Graphics, so that it is easy to drop-in to your projects and operates smoothly on iOS devices. The library itself will also be used in Alien Blue's upcoming iOS updates.

How it looks

Here's what JMTabView looks like:

And on a retina display:

Usage

A demo project is included in this repository so that you can dive right in. In brief, to draw the tab view, you can do the following:

JMTabView * tabView = [[[JMTabView alloc] initWithFrame:frame] autorelease];

[tabView setDelegate:self];

You can then add tab items:

[tabView addTabItemWithTitle:@"One" icon:[UIImage imageNamed:@"icon1.png"]];

By implementing the tabView:didSelectTabAtIndex: method, you will receive a callback when the tab selection changes.

Flexibility

You can set the icon: to nil if you prefer to use text only, or title: to nil to show icons only.

If you prefer to use JMTabView as a toolbar you can use the setMomentary: method to change its selection behaviour.

JMTabView also supports the execution of blocks so that you can embed your logic per tab item, like this:

[tabView addTabItemWithTitle:@"Tab" icon:nil executeBlock:^{ // do stuff after item has been selected }];

Customisation

You can subclass JMTabItem and JMSelectionView to completely customize the view of the tabs. For example, in the inclusive Demo you can see how I've customized the view to render tabs like this:

Installation

If you prefer to use JMTabView as a dynamic library in your project, please be sure to add -ObjC -all_load to your target's Other Linker Flags. Alternatively, you can reference the .h and .m files directly.

Acknowledgements

This project uses the UIView+Positioning and UIView+Size categories developed by the very talented Kevin O'Neill.

License

JMTabView is BSD licensed, so you can freely use it in commercial applications.

jmtabview's People

Contributors

jasonmorrissey avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.