Next/Previous Keyboard Toolbar iOS7

前端 未结 7 1106
情书的邮戳
情书的邮戳 2021-02-01 05:33

Currently, I am trying to set the next/previous buttons on my keyboard toolbar to the new, sleek iOS 7 back button/forward buttons that get put in navigation controllers to go b

7条回答
  •  臣服心动
    2021-02-01 05:46

    Use the icons shared by Joshua and then try with below piece of code and you will be good to go. I have not added the done button here.

    UIImage *backImage = [[UIImage imageNamed:@"backImage"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    UIImage *forwardImage = [[UIImage imageNamed:@"forward"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    self.segmentedControl = [[UISegmentedControl alloc] initWithItems:@[backImage, forwardImage]];
    [self.segmentedControl addTarget:self action:@selector(segmentedControlChangedState:) forControlEvents:UIControlEventValueChanged];
    self.segmentedControl.segmentedControlStyle = UISegmentedControlStyleBar;
    self.segmentedControl.tintColor = [UIColor clearColor];
    UIBarButtonItem *aSegmentedControlBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:self.segmentedControl];
    [self setItems:@[aSegmentedControlBarButtonItem, self.flexibleSpace]];
    

提交回复
热议问题