0

Was wondering if anyone knew how to implement arrows in the bottom toolbar as shown below? Would be extremely grateful if someone could give me insight into this. I have seen a lot of apps with such arrows to navigate through pages and cannot seem to find them in XCode. See below...

THX :)

enter image description here

Masterminder
  • 1,127
  • 7
  • 21
  • 31

2 Answers2

1

Just set a UIToolbar and attach it those two images (i'll give you the archive link with both images standard and retina): link

//Creating UIToolbar
    toolBar = [[UIToolbar alloc]init];
    toolBar.frame = CGRectMake(//set some frame);
    toolBar.barStyle = UIBarStyleBlackOpaque;
    [toolBar sizeToFit]; 

    //Creating buttons
    UIBarButtonItem *prev = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"previous.png"] style:UIBarButtonItemStylePlain target:self action:@selector(myaction:)] autorelease]; 
UIBarButtonItem *next = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"next.png"] style:UIBarButtonItemStylePlain target:self action:@selector(myaction:)] autorelease]; 

     //Creating the array with the buttons
     NSArray *items = [NSArray arrayWithObjects:prev,next, nil];

//Assigning the array to the toolbar
[toolBar setItems:items];
    [self.view addSubview:toolBar];
    [toolBar release]; 

You are done!

Phillip
  • 4,276
  • 7
  • 42
  • 74
  • I took them from a open-source iOS GUI. – Phillip Jun 22 '12 at 18:27
  • Thanks buddy! Appreciate it a lot. – Masterminder Jun 22 '12 at 18:28
  • Where would I implement this by the way? In the view controller class file for that view correct? – Masterminder Jun 22 '12 at 18:30
  • Yes, basically in the viewController where you want to place the UIToolbar. – Phillip Jun 22 '12 at 18:30
  • Do you know if I can Control drag the tool bar into the viewController file and go from there, will have the same effect as beginning with hard code as you have shown me above? I am using XCode 4.3.2, which is why I ask – Masterminder Jun 22 '12 at 19:00
  • Well yeah, if you have a viewController you can place the UIToolbar anywhere, just declare an IBOutlet and connect it to IB, and delete the framing part due you're inserting it visually. – Phillip Jun 22 '12 at 19:03
0

I'm guessing those arrows were custom made by Apple for Safari, Photo Library, etc.
I think you can make those in Paint if you don't have something along the lines of Photoshop.

OFRBG
  • 1,653
  • 14
  • 28