inputtoolbar icon indicating copy to clipboard operation
inputtoolbar copied to clipboard

Properly align text field when using on iPad

Open mgrebenets opened this issue 12 years ago • 1 comments

When view is used on iPad, the position of input field (UIExpandingTextView) is misaligned after autorotation. It looks like it can be fixed with code like this

    self.textView.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleWidth;

when setting up toolbar. I didn't look further though to find a way to make input field wider when used on iPad screen. It can be surely done by detecting device in runtime.

mgrebenets avatar Apr 08 '12 13:04 mgrebenets

Hi, Thanks for the feedback. I have not tried to use this on the iPad at all.

To make the input field wider, you would probably just need to set the correct value for the frame boundary when the toolbar creates the textview component.

Look at line 73 of the UIInputToolbar.m file

self.textView = [[UIExpandingTextView alloc] initWithFrame:CGRectMake(7, 7, 236, 26)];

brandonhamilton avatar Apr 09 '12 13:04 brandonhamilton