Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Draw default dots in code #4

Closed
kgn opened this Issue · 2 comments

2 participants

David Keegan Randy Luecke
David Keegan

This code is un-tested but it should work to draw a circle with 60% transparency, and a white circle.

- (UIImage *)normalDot{
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(8, 8), NO, 0.0f);
    UIBezierPath *ovalPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, 8, 8)];
    [[UIColor colorWithWhite:1 alpha:0.6] setFill];
    [ovalPath fill];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}

- (UIImage *)activeDot{
    UIGraphicsBeginImageContextWithOptions(CGSizeMake(8, 8), NO, 0.0f);
    UIBezierPath *ovalPath = [UIBezierPath bezierPathWithOvalInRect:CGRectMake(0, 0, 8, 8)];
    [[UIColor whiteColor] setFill];
    [ovalPath fill];
    UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return image;
}
Randy Luecke
Owner

I don't understand the issue...

David Keegan

Sorry I should have given more context. Instead of requiring image assets to get the project working out of the box you could draw images in code and use them. Just a suggestion, not really an issue :)

https://github.com/Me1000/RLPageControl/blob/master/RLPageControl.m#L50

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.