Custom navigationItem button with QLPreviewController in iOS6

后端 未结 5 1141
悲哀的现实
悲哀的现实 2020-12-09 12:06

my goal is to use QLPreviewController in my iPad application for iOS6, using my custom Action item button in the top toolbar. I had solution until iOS5.1. I used a class tha

5条回答
  •  甜味超标
    2020-12-09 12:37

    I tried for a long time to replace this button. Looked to subviews, etc. Looks like this actions/share button is put as a layer to the nav. bar. I ended up by solving this issue for myself by adding one more button instead of title in QLPreviewController subclass.

    - (void)viewDidLoad
    {
        [super viewDidLoad];
    
        // Button in center of Navigation Bar
        UISegmentedControl *button = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:LS(@"Save"), nil]];
        button.frame = CGRectMake(0, 0, 100, 30);
        button.center = self.view.center;
        button.momentary = YES;
        button.segmentedControlStyle = UISegmentedControlStyleBar;
        button.tintColor = [UIColor colorWithHue:0.6 saturation:0.33 brightness:0.69 alpha:0];
        [button addTarget:self action:@selector(saveToDocumentsClicked) forControlEvents:UIControlEventValueChanged];
        self.navigationItem.titleView = button;
    }
    

提交回复
热议问题