Coder Social home page Coder Social logo

ddpagecontrol's Introduction

An easily customizable alternative to UIKit's UIPageControl

DDPageControl redefines exactly every property and methods available in UIPageControl.
Using DDPageControl without customization will actually lead exactly to a UIPageControl.

However, the power of DDPageControl is that you can set some additional properties that will affect the way the look and feel of the page controls.

There are two color properties: one for 'on' controls and one for 'off' controls. You are free to pass an alpha channel for any of these colors'

You can also set the type of indicators you want as a filled circle or a simple ellipse.

Finally, the diameter of every indicator and their spacing is also customizable by setting a couple of properties.

ddpagecontrol's People

Contributors

brarielitovsky 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

ddpagecontrol's Issues

Dots don't disappear on a single page

I'm implementing DD Page Control, but I have an issue regarding hiding the control when only one page is displayed. I have imported the DDPageControl class, and added to the main view controller the following code:

int numberOfPages = 1;

dotsControl = [[DDPageControl alloc] init] ;
[dotsControl setHidesForSinglePage:YES];
[dotsControl setCenter: CGPointMake(self.view.center.x, self.view.bounds.size.height-20.0f)];
[dotsControl setAutoresizingMask:UIViewAutoresizingFlexibleBottomMargin];
[dotsControl setNumberOfPages: numberOfPages];
[dotsControl setCurrentPage:0] ;
[dotsControl setDefersCurrentPageDisplay: YES] ;
[dotsControl setType: DDPageControlTypeOnFullOffEmpty] ;
[dotsControl setOnColor: [UIColor colorWithRed:(250.0/255.0) green:(170.0/255.0) blue:(0.0/255.0) alpha:1.0]] ;
[dotsControl setOffColor: [UIColor colorWithWhite: 0.7f alpha: 1.0f]] ;
[dotsControl setIndicatorDiameter: 7.0f] ;
[dotsControl setIndicatorSpace: 7.0f] ;

[self.view insertSubview:dotsControl belowSubview:thumbnailControl];

but dots are always drawed also on views of only 1 page

Tag the repository

Hey Damien,

I wanted to add DDPageControl to CocoaPods, so people can use it even more easily in their own projects. However, it would be very helpful for me if you could tag the current branch with a version number, e.g. "0.1". That way we can create a pod file that will always work.

Thanks,
Chris

UITextAlignmentCenter deprecated

UITextAlignmentCenter is/was first deprecated in iOS 6.0.
Simply replace UITextAlignmentCenter by NSTextAlignmentCenter will do the job.

Is it possible to change width of the view?

I am trying to change width of the control, to make it as wide as screen width:

DDPageControl *pageControl = [[DDPageControl alloc] init];
pageControl.numberOfPages = 4;
pageControl.currentPage = 0;
pageControl.indicatorDiameter = 5.0;
pageControl.frame = CGRectMake(0.0, 300.0, 320.0, 36.0);

This doesn't work for me, the width always equals to 100.0

How can I change this parameter?

Thanks.

A couple of questions about some code

Hello,

I am trying to understand some of the code in DDPageControl. Could you clarify the following:

  1. What is accomplished by this? Seems redundant
// correct the bounds accordingly
self.bounds = self.bounds
  1. In setFrame: and setBounds: Why is bounds assigned to super's bounds, not self?
super.bounds = aBounds;

Thanks!

How to limit the width of the page control ?

If i add a lot of pages, the DDPageControl component extend its size beyond the size of the device.
I am trying to limit the width of the component, but how can I still show to the user where he is in the scrollview ?

ios7 Error

I use ddpagecontrol and thanks a lot but it has an error ios7 like below image.

screen shot 2013-11-16 at 14 35 27

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.