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

      

  • 相关阅读:
    PHP基础之文件的上传与下载
    PHP封装 文件上传
    PHP基础之文件操作
    Session案例:实现用户登录
    PHP基础之会话技术
    PHP基础之超全局变量
    PHP基础之HTTP协议
    PHP基础之错误处理及调试
    PHP基础之包含文件
    剑指offer-复杂链表的复制
  • 原文地址:https://www.cnblogs.com/neozhu/p/2939455.html
Copyright © 2011-2022 走看看