zoukankan      html  css  js  c++  java
  • 自定义ios keyboard tool bar代码片段

    -(UIToolbar *)createActionBar {
        UIToolbar *actionBar = [[UIToolbar alloc] init];
        actionBar.translucent = YES;
        [actionBar sizeToFit];
        actionBar.barStyle = UIBarStyleBlackTranslucent;
    
        UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Done", @"")
                                                                       style:UIBarButtonItemStyleDone target:self
                                                                      action:@selector(handleActionBarDone:)];
    
        _prevNext = [[UISegmentedControl alloc] initWithItems:[NSArray arrayWithObjects:NSLocalizedString(@"Previous", @""), NSLocalizedString(@"Next", @""), nil]];
        _prevNext.momentary = YES;
        _prevNext.segmentedControlStyle = UISegmentedControlStyleBar;
        _prevNext.tintColor = actionBar.tintColor;
        [_prevNext addTarget:self action:@selector(handleActionBarPreviousNext:) forControlEvents:UIControlEventValueChanged];
        UIBarButtonItem *prevNextWrapper = [[UIBarButtonItem alloc] initWithCustomView:_prevNext];
        UIBarButtonItem *flexible = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
        [actionBar setItems:[NSArray arrayWithObjects:prevNextWrapper, flexible, doneButton, nil]];
    
    	return actionBar;
    }
    
    
    
    if (_entryElement.hiddenToolbar){
            _textField.inputAccessoryView = nil;
        } else {
            _textField.inputAccessoryView = [self createActionBar];
        }
    

      

  • 相关阅读:
    hdu4521(线段树+dp)
    【Leetcode】Container With Most Water
    【Leetcode】Trapping Rain Water
    【Leetcode】Valid Sudoku
    【Leetcode】Combinations
    【Leetcode】Permutations II
    【Leetcode】Permutations
    【Leetcode】Permutation Sequence
    【Leetcode】Next Permutation
    【Leetcode】Remove Element
  • 原文地址:https://www.cnblogs.com/neozhu/p/2939455.html
Copyright © 2011-2022 走看看