UIView atop the Keyboard similar to iMessage App

前端 未结 5 1174
眼角桃花
眼角桃花 2020-12-04 14:38

currently I\'m attempting to basically implement and exact copy of Apples iMessage App.

That means I need a UITextView that is docked at the bottom of the screen, an

5条回答
  •  不知归路
    2020-12-04 15:26

    I recently ran into the same problem, and had to build out a custom solution as I wasn't entirely happy with the available 3rd party libraries. I've split out this implementation into it's own GitHub project:

    MessageComposerView

    From some simple testing on iOS 6.1 7 & 8 simulators the rotations seem to properly follow the keyboard. The view will also grow with text and resize automatically on rotation.

    MessageComposerView

    You can use a very basic init function like so to create it with screen width and default height e.g.:

    self.messageComposerView = [[MessageComposerView alloc] init];
    self.messageComposerView.delegate = self;
    [self.view addSubview:self.messageComposerView];
    

    There are several other initializers that are also available to allow you to customize the frame, keyboard offset and textview max height. See readme for more!

提交回复
热议问题