MFMessageComposeViewController后没有显示键盘(Keyboard not showing after MFMessageComposeViewController)
在iPhone应用程序中,我有一个
UITextView
和一个按钮,它允许用户将UITextView
的内容作为文本消息发送。 代码如下所示:MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; picker.messageComposeDelegate = self; picker.body = textView.text; [self presentModalViewController:picker animated:YES];
一切工作正常,除了消息发送时或在
MFMessageComposer
点击Cancel时: 即使光标闪烁,UITextView
的键盘也不再显示 。我尝试了一些东西,包括按钮代码和
-viewDidDisappear
的[textView resignFirstRepsonder]
。MFMessageComposeViewControllerDelegate
方法中的[textView becomeFirstResponder]
或-viewDidAppear
不会更改任何内容...有任何想法吗?
In an iPhone app I have a
UITextView
and a button, which lets the user send the content of theUITextView
as a text message. The code looks like this:MFMessageComposeViewController *picker = [[MFMessageComposeViewController alloc] init]; picker.messageComposeDelegate = self; picker.body = textView.text; [self presentModalViewController:picker animated:YES];
Everything works fine, except for when the message is either sent or Cancel is tapped in the
MFMessageComposer
: The keyboard for theUITextView
is not shown anymore, even though the cursor blinks.I tried a few things, including a
[textView resignFirstRepsonder]
in both the button code and-viewDidDisappear
.[textView becomeFirstResponder]
in theMFMessageComposeViewControllerDelegate
method or the-viewDidAppear
didn't change anything either...Any ideas?
原文:https://stackoverflow.com/questions/4768425
最满意答案
首先想到的是我注意到标签标签没有关闭“>”。 它不在HTML代码中,但表单标签的ID是否为“form”?
两行var $ answer ...和var answer ...可以合并为
var answer = $('#unit_name').val();
最后,在你的html代码中,你有一个id =“result”的div(或其他标签)吗? 如果是这样,它隐藏了吗? 如果它是隐藏的,设置完信息后,您需要取消隐藏。
First think I noticed is that the label tag doesn't have a closing ">". It isn't in the HTML code, but does the form tag have an id of "form"?
The two lines var $answer... and var answer... could be combined to
var answer = $('#unit_name').val();
Lastly, in your html code, do you have a div (or other tag) with an id="result"? If so, is it hidden? If it is hidden, after setting your message, you will need to un-hide it.
相关问答
更多-
你想要resetForm()方法: var validator = $("#myform").validate( ... ... ); $(".cancel").click(function() { validator.resetForm(); }); 我从他们的一个演示的来源抓住了它。 注意:此代码将不适用于Bootstrap 3。 You want the resetForm() method: var validator = $("#myform").validate( ...
-
如果要隐藏验证错误消息,则应该使用resetForm函数而不是hideErrors函数。 正如在他们的回答中提到的, resetForm在内部调用hideErrors函数。 但是,这里有一个转折点 ,当你尝试使用resetForm函数时,它不会工作,因为jquery.validate.unobtrusive插件的工作方式。 jquery.validate.unobtrusive插件覆盖jquery.validate插件的errorClass和errorElement属性。 从jquery.validate. ...
-
JQuery自定义验证错误(JQuery custom validation error)[2021-07-25]
看看这个,找不到验证器,因为它正在查看$()内部。 你需要使用$.validator.addMeth....它进入默认的jquery对象。 喜欢这个: $.validator.addMethod("defaultInvalid", function(value, element) { alert("validate"); }); 或者用于访问Jquery对象的任何内容 JQuery.validator.addMethod("defaultInvalid", function( ... -
rules ,请执行: messages: { checkboxes: { minlength: 'Please check at least 3 boxes.' } } After your rules, do: messages: { checkboxes: { minlength: 'Please check at least 3 boxes.' } }
-
我的JQuery验证错误(Error in my JQuery validation)[2022-10-08]
首先想到的是我注意到标签标签没有关闭“>”。 它不在HTML代码中,但表单标签的ID是否为“form”? 两行var $ answer ...和var answer ...可以合并为 var answer = $('#unit_name').val(); 最后,在你的html代码中,你有一个id =“result”的div(或其他标签)吗? 如果是这样,它隐藏了吗? 如果它是隐藏的,设置完信息后,您需要取消隐藏。 First think I noticed is that the label tag do ... -
此问题是由我正在使用的JQuery Validation插件引起的。 我使用Nuget更新到最新的JQuery Validation Plugin(1.11),现在一切正常。 希望这对将来有所帮助。 This problem was caused by the JQuery Validation plugin that I was using. I updated to the newest JQuery Validation Plugin (1.11) using Nuget and everything ...
-
您需要在文档加载中添加检查子句以显示隐藏的输入字段 $(document).ready(function () { // Show the input if the checkbox is checked if ($("#penerima_beda").is(":checked")) { $("#panel_penerima").css("display", "block"); $("#nama_penerima").attr("required", "re ...
-
使用jquery进行验证(validation using jquery)[2022-12-12]
使用jQuery插件番茄酱,它使用少量浮动对话泡泡,因此不需要太多的空间。 Use the jQuery plug-in Ketchup it uses little floating talk bubbles so not as much space is needed. -
解 您的错误是您将函数传递给validate : $("#testform").validate(function() { // <-- here you're passing a function // ... }) 其中validate需要一个对象: $("#testform").validate({ // <-- but you should pass an object // ... }); 语法错误是在函数表达式上声明对象属性的结果。 $("#testform").validate(f ...
-
错误消息“元素”的唯一原因是因为两者都是内联元素(
相关文章
更多- Android EditText软键盘显示隐藏以及“监听”
- 登录界面与Android软键盘显示、隐藏的交互设计
- 用C#捕捉键盘和鼠标
- 关于jsp中的分页显示问题
- 在线文档显示打印
- dreamweaver 8 与 ie 7 的显示的效果不同?
- freemarker的时间显示如何处理啊
- EditorGridPanel中ComboBox显示问题?
- js页面显示广告
- Obama says economy moving in right direction
最新问答
更多- 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
- Java中的不可变类(Immutable class in Java)
- 寻求多次出现的表达式(Seeking for more than one occurrence of an expression)
- linux只知道文件名,不知道在哪个目录,怎么找到文件所在目录
- Actionscript:检查字符串是否包含域或子域(Actionscript: check if string contains domain or subdomain)
- 懒惰地初始化AutoMapper(Lazily initializing AutoMapper)
- 使用hasclass为多个div与一个按钮问题(using hasclass for multiple divs with one button Problems)
- Windows Phone 7:检查资源是否存在(Windows Phone 7: Check If Resource Exists)
- EXCEL VBA 基础教程下载
- RoR - 邮件中的动态主体(部分)(RoR - Dynamic body (part) in mailer)
- 无法在Google Script中返回2D数组?(Can not return 2D Array in Google Script?)
- JAVA环境变量的设置和对path , classpth ,java_home设置作用和目的?
- mysql 关于分组查询、时间条件查询
- 如何使用PowerShell匹配运算符(How to use the PowerShell match operator)
- Effective C ++,第三版:重载const函数(Effective C++, Third edition: Overloading const function)
- 如何用DELPHI动态建立MYSQL的数据库和表? 请示出源代码。谢谢!
- 带有简单redis应用程序的Node.js抛出“未处理的错误”(Node.js with simple redis application throwing 'unhandled error')
- 使用前端框架带来哪些好处,相对于使用jquery
- Ruby将字符串($ 100.99)转换为float或BigDecimal(Ruby convert string ($100.99) to float or BigDecimal)
- 高考完可以去做些什么?注意什么?
- 如何声明放在main之后的类模板?(How do I declare a class template that is placed after the main?)
- 如何使用XSLT基于兄弟姐妹对元素进行分组(How to group elements based on their siblings using XSLT)
- 在wordpress中的所有页面的标志(Logo in all pages in wordpress)
- R:使用rollapply对列组进行求和的问题(R: Problems using rollapply to sum groups of columns)
- Allauth不会保存其他字段(Allauth will not save additional fields)
- python中使用sys模块中sys.exit()好像不能退出?
- 将Int拆分为3个字节并返回C语言(Splitting an Int to 3 bytes and back in C)
- 在SD / MMC中启用DDR会导致问题吗?(Enabling DDR in SD/MMC causes problems? CMD 11 gives a response but the voltage switch wont complete)
- sed没有按预期工作,从字符串中间删除特殊字符(sed not working as expected, removing special character from middle of string)
- 如何将字符串转换为Elixir中的函数(how to convert a string to a function in Elixir)