Filter the string when inputting in textField. Only Chinese characters can be input, and no other input is allowed
怪我咯2017-05-02 09:29:53
During the input process, I first use regular expressions to determine whether the input is Chinese. If it is Chinese, assign it to textfiled.text, and then store this value in a global variable. Later, when textfiled.text changes, if there is a non-Chinese character Characters, use the previously stored global variables to intercept the string, and only the Chinese string is assigned to textfiled.text, so that textfiled can only input Chinese during the input process.
漂亮男人2017-05-02 09:29:53
You can judge the text in the proxy method. If there are English numbers, just delete them
滿天的星座2017-05-02 09:29:53
This may not be possible, because when typing Chinese pinyin before finishing typing, the English words will be displayed. If there are non-Chinese characters in the construction, the save button will be grayed out, and the user will be prompted to delete the non-Chinese characters.