zoukankan      html  css  js  c++  java
  • 设置键盘顶部显示的工具条

    - (void)createKeyboardTool
    {
        keyboardTool = [[UIToolbar alloc] initWithFrame: CGRectMake(kZero, kZero, kScreenW, 44.0f)];
        NSMutableArray *myToolBarItems = [NSMutableArray array];
    
      //创建键盘工具条上面的按钮,并设置点击事件 UIBarButtonItem
    *cancelBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemReply target:self action:@selector(cancelAction)]; UIBarButtonItem *space = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:@selector(saveAction)]; UIBarButtonItem *saveBtn = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(saveAction)]; [myToolBarItems addObject:cancelBtn]; [myToolBarItems addObject:space]; [myToolBarItems addObject:saveBtn]; keyboardTool.items = myToolBarItems; }
        //inputAccessoryView:设置键盘顶部显示的工具条;inputView:自定义键盘
    commentTextView = [[UITextView alloc]initWithFrame:CGRectMake(kZero, kZero, kScreenW, 200)]; [commentTextView becomeFirstResponder]; commentTextView.inputAccessoryView = keyboardTool;
  • 相关阅读:
    【CSS】 布局之圣杯布局
    PHP函数
    spry菜单栏(二)
    正则表达式补充
    练习用php做表格
    PHP入门
    MySQL常用函数
    数据库习题
    总结
    Navicat
  • 原文地址:https://www.cnblogs.com/hw140430/p/3889557.html
Copyright © 2011-2022 走看看