简体   繁体   English

MIT APP Inventor 2 文本框属性为 integer

[英]MIT APP Inventor 2 text box property as integer

I needs a text box which only allow integers bigger than "0".我需要一个只允许大于“0”的整数的文本框。 My blocks can make it to only accept positive numbers, but I have no idea how to make it an integer.我的块可以使它只接受正数,但我不知道如何使它成为 integer。

you only can set the textbox to numbers only true or false...您只能将文本框设置为仅数字真或假...
but you could try the textbox extension and its AfterTextChanged event to check, if a number < 0 was entered...但是您可以尝试使用文本框扩展程序及其AfterTextChanged事件来检查是否输入了数字 < 0...

在此处输入图像描述

Please refer to the below.请参考以下内容。 Tried to judge if it's a number first and then "round" it to be integer and then "absolute" it to be positive number.试图先判断它是否是一个数字,然后将其“四舍五入”为 integer 然后“绝对”它为正数。

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM