inputView  设置用于展示的响应View 类似于键盘的展示方式

inputAccessoryView 用于设置响应View上面的ToolBar

使用方式:

inputView设置为响应View展示在键盘位置

inputAccessoryView  设置键盘上的toolBar

 

// 创建toolBar

UIToolbar *toolBar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, getWidth(40))];

UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] initWithTitle:LA_BT_ME_DONE style:UIBarButtonItemStylePlain target:self action:@selector(doneTouched:)];

[toolBar setItems:[NSArray arrayWithObjects:[[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil], doneButton, nil]];

 

_pickTextField.inputView = self.selectPickerView;

_pickTextField.inputAccessoryView = toolBar;

相关文章:

  • 2021-05-27
  • 2022-12-23
  • 2022-12-23
  • 2021-09-17
  • 2021-08-11
  • 2021-11-16
  • 2021-04-14
  • 2022-12-23
猜你喜欢
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案