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];
        }
    

      

  • 相关阅读:
    附加:CSS大全
    HTML 三
    HTML 二
    HTML 一
    20150106--SQL事务操作+触发器二
    20150106--SQL事务操作+触发器一
    20141229 mysql基本操作二
    Oracle基础知识
    JDBC事务
    jsp内置/隐式对象(9个)与el表达式
  • 原文地址:https://www.cnblogs.com/neozhu/p/2939455.html
Copyright © 2011-2022 走看看