Giter VIP home page Giter VIP logo

ios-cabin's Introduction

ios-cabin

my collection of ios utils.

PagedImageScrollView

  • swipe fingers to left or right can change the image

  • when you click the little dot at the right corner, you also can switch the image page by page.

  • It is more productive because you can use 3-5 lines of code to finish the same function that you used to complete using almost 80-100 lines.

  • Import: It is not a real system protogenetic(原生的) UIScrollView, in fact it is a UIView that contains UIScrollView and UIPageControl.

  • requirement: iOS >= 5.0

PagedImageScrollView Usage

after importing "PagedImageScrollView.h", place this code in ViewDidLoad method of your viewcontroller.

PagedImageScrollView *pageScrollView = [[PagedImageScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 120)];
[pageScrollView setScrollViewContents:@[[UIImage imageNamed:@"xyq.jpeg"], [UIImage imageNamed:@"x2.jpeg"], [UIImage imageNamed:@"xyq.jpeg"], [UIImage imageNamed:@"x2.jpeg"]]];
//easily setting pagecontrol pos, see PageControlPosition defination in PagedImageScrollView.h
pageScrollView.pageControlPos = PageControlPositionCenterBottom;
[self.view addSubview:pageScrollView];

JXBarChartView

  • generate horizontal bar chart with text indicator on the left of bar and digit indicator on the right of bar, and the bar is drawn with gradient(渐变), so it is cooler than immutable color

JXBarChartView Usage

after import "JXBarChartView.h", place this code in ViewDidLoad method of your viewcontroller.

[super viewDidLoad];
NSMutableArray *textIndicators = [[NSMutableArray alloc] initWithObjects:@"标签1", @"标签2", @"标签3", @"标签4", @"标签5", nil];
NSMutableArray *values = [[NSMutableArray alloc] initWithObjects:@0, @5, @10, @3, @7, nil];
CGRect frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);
JXBarChartView *barChartView = [[JXBarChartView alloc] initWithFrame:frame
                                                          startPoint:CGPointMake(20, 20)
                                                              values:values maxValue:10
                                                      textIndicators:textIndicators
                                                           textColor:[UIColor orangeColor]
                                                           barHeight:20
                                                         barMaxWidth:150
                                                            gradient:nil];
[self.view addSubview:barChartView];

ios-cabin's People

Contributors

jianpx avatar

Watchers

 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.