正如您在此中看到的那樣,當我觸摸textarea時,鍵盤會變得過高。任何想法是什麼導致這個特定的問題。我怎樣才能讓鍵盤粘到屏幕的底部?iOS,當觸摸textarea時,鍵盤會自動向上
[更新](代碼):
#import "ViewController.h" #import <MessageUI/MessageUI.h> @interface SettingsViewController() <MFMailComposeViewControllerDelegate> @end @implementation ViewController - (IBAction)feedBack:(id)sender { NSString *iOSVersion = [[UIDevice currentDevice] systemVersion]; NSString *model = [[UIDevice currentDevice] model]; NSString *version = @"1.0"; MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init]; mailComposer.mailComposeDelegate = self; [mailComposer setToRecipients:[NSArray arrayWithObjects: @"[email protected]",nil]]; [mailComposer setSubject:[NSString stringWithFormat: @"Feedback about App V%@",version]]; NSString *supportText = [NSString stringWithFormat:@"Device: %@\niOS Version:%@\n\n",model,iOSVersion]; supportText = [supportText stringByAppendingString: @"Please write your feedback or suggestions"]; [mailComposer setMessageBody:supportText isHTML:NO]; [self presentViewController:mailComposer animated:YES completion:nil]; } - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult: (MFMailComposeResult)result error:(NSError *)error { [self dismissViewControllerAnimated:YES completion:nil]; }
這不是默認行爲,所以除非你顯示一些代碼,否則很難確定是什麼原因造成的。 – Vrasidas
你如何呈現視圖控制器? – Wain
嘿,這是非常奇怪的。狂猜,你是否在任何地方使用inputAccessoryView? – Fattie