-1

I use native UIPageControl in my objective-c application and I want to have a rectangular dots instead of circular one. I searched about that and for a library providing this but I didn’t found anything.

I tried to do it like this but it has no effect:

-(void)updateDotsFormat {
    for (int i = 0; i < [self.pageControl.subviews count]; i++)
    {

        UIView* dot = [self.pageControl.subviews objectAtIndex:i];
        UIView* dotView = [[UIView alloc] init];
        dotView.backgroundColor = [UIColor blueColor];
        CGRect frame = dotView.frame;
        frame.size.width = 50;
        frame.size.height = 20;
        dotView.frame = frame;
        [dot addSubview:dotView];

    }
}

How can I set the dots format to rectangle?

Ne AS
  • 1,490
  • 3
  • 26
  • 58

1 Answers1

0

and I want to have a rectangular dots instead of circular one. I searched a that and for a library providing this but I didn’t found anything

Well, you would have to design your own view/control, since UIPageControl has no such ability. There are libraries for such a thing, but asking for one is not permitted on Stack Overflow; or you can write it yourself.

matt
  • 515,959
  • 87
  • 875
  • 1,141
  • I didn't ask for a library. I ask for the way to do it – Ne AS Feb 02 '17 at 17:02
  • Well, it's a view containing a row of shapes (yours will be rectangles) that keeps a count and changes the color of the shapes depending on that count. It also permits a tap at the right or left to change the count, and emits a control event when that happens. – matt Feb 02 '17 at 17:03