Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You would want to add the textfield and button inside of the footer. You can use keyboard notifications to move the view offset so that your textfield will be visible when the user is typing in the keyboard.</p> <p>Footer: *I'm assuming the textfield and send button are ivars.</p> <pre><code>// add footer to table UIView *footerView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, self.view.frame.size.width, 85.0f)]; if(yourTextField ==nil){ yourTextField = [[UITextField alloc] initWithFrame:CGRectMake(5,5,200,35)]; } if(yourSendButton ==nil){ yourSendButton = [[UIButton alloc] initWithFrame:CGRectMake(225,5,75,35)]; yourSendButton addTarget:self action:@selector(sendBtnClicked) forControlEvents:UIControlEventTouchUpInside]; } [footerView addSubview:yourTextField]; [footerView addSubview:yourSendButton]; [tableView setTableFooterView:footerView]; </code></pre> <p>Here is some example code for moving the view for the keyboard:</p> <pre><code>- (void)keyboardWillShow:(NSNotification *)notification { NSValue *keyboardFrameValue = [[notification userInfo] objectForKey:UIKeyboardFrameEndUserInfoKey]; CGRect keyboardFrame = [[self view] convertRect:[keyboardFrameValue CGRectValue] fromView:nil]; NSNumber *duration = [[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey]; [UIView animateWithDuration:[duration floatValue] animations:^{ [scrollView setFrame:CGRectMake(scrollView.frame.origin.x, scrollView.frame.origin.y, scrollView.frame.size.width, keyboardFrame.origin.y - scrollView.frame.origin.y)]; }]; } - (void)keyboardWillHide:(NSNotification *)notification { NSNumber *duration = [[notification userInfo] objectForKey:UIKeyboardAnimationDurationUserInfoKey]; [UIView animateWithDuration:[duration floatValue] animations:^{ [scrollView setFrame:CGRectMake(scrollView.frame.origin.x, scrollView.frame.origin.y, scrollView.frame.size.width, self.view.frame.size.height - (iPhone ? 44.0f : 0.0f))]; }]; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload