Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6205589
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:18:07+00:00 2026-05-24T05:18:07+00:00

I have UIPageControl which I have made custom its dot color is not changing

  • 0

I have UIPageControl which I have made custom its dot color is not changing

- (void)drawRect:(CGRect)rect {

    if (hidesForSinglePage == NO || [self numberOfPages] > 1){
        if (activePageColor == nil){
            activePageColor = [UIColor blackColor];
        }

        if (inactivePageColor == nil){
            inactivePageColor = [UIColor grayColor];
        }

    CGContextRef context = UIGraphicsGetCurrentContext();

    //  float dotSize = self.frame.size.height / 6;
    float dotSize = self.frame.size.height / 2;
    float dotsWidth = (dotSize * [self numberOfPages]) + (([self numberOfPages] - 1) 10);

    float offset = (self.frame.size.width - dotsWidth) / 2;

    for (NSInteger i = 0; i < [self numberOfPages]; i++){
        if (i == [self currentPage]){
            CGContextSetFillColorWithColor(context, [activePageColor CGColor]);
        } else {
            CGContextSetFillColorWithColor(context, [inactivePageColor CGColor]);
        }

        CGContextStrokeEllipseInRect(context, CGRectMake(offset + (dotSize + 10) * i,(self.frame.size.height / 2) - (dotSize / 2), dotSize, dotSize));
    }
}

if I change CGContextStrokeEllipseInRect with CGContextFillEllipseInRect then its changing but I want to use CGContextStrokeEllipseInRect

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:18:08+00:00Added an answer on May 24, 2026 at 5:18 am

    You’re setting the fill color, but you want to use a stroke function. Use CGContextSetStrokeColorWithColor instead of CGContextSetFillColorWithColor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a UIPageControl. When I click on a dot to change the page,
Have just started using Visual Studio Professional's built-in unit testing features, which as I
I have page control but not navigating to other view. so please provide the
I am making an iPhone app which has a requirement to implement the UIPageControl.
I have a basic RSS Reader I made from three20 tutorials using TTLauncherView as
I have 5 pics to display (one at a time) in a UIPageControl way,
I have an issue with the UIPageControl . I simplified the issue for clarity
hi i have uiscrollview and uipage control and in uiscrollview i have buttons (custom
Have just started using Google Chrome , and noticed in parts of our site,
Have you ever seen any of there error messages? -- SQL Server 2000 Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.