清除文本字段黑莓
Posted
技术标签:
【中文标题】清除文本字段黑莓【英文标题】:Clearing textfield blackberry 【发布时间】:2013-07-24 09:25:51 【问题描述】:如何清除黑莓中的TextField
?这是qml:
Container
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
leftPadding: 75
rightPadding: leftPadding
bottomPadding: 40
TextField
id: tfComment
hintText: qsTr("add comment")
inputMode: TextFieldInputMode.Text
input
submitKey: SubmitKey.Submit
onSubmitted:
cppObj.onCommentSubmitClicked(tfComment.text, "");
lComment.text = tfComment.text;
Container
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Bottom
bottomPadding: 200
leftPadding: 20
rightPadding: leftPadding
Label
id: lComment
verticalAlignment: VerticalAlignment.Bottom
horizontalAlignment: HorizontalAlignment.Center
text: cppObj.desc
我想清除输入到TextField
的数据,以便我可以评论另一个。我该怎么做?
【问题讨论】:
【参考方案1】:textField->resetText()
文档在这里:
http://developer.blackberry.com/cascades/reference/bb__cascades__textfield.html
【讨论】:
【参考方案2】:在onSubmitted
处理程序中试试这个:
tfComment.Text = ""
【讨论】:
以上是关于清除文本字段黑莓的主要内容,如果未能解决你的问题,请参考以下文章