我的应用程序正在将已经复制到其中的特殊格式转换为"“。我不想允许这种情况发生,但我已经尝试了相当多的输入类型,但我尝试的输入类型都不能阻止它的发生。理想情况下,我希望自动格式化,但如果需要,可以在用户复制进来后在后台删除它。
布局文件中的EditText:
<EditText
android:id="@+id/edit_recipe_ingredients"
style="@style/EditorFieldStyle"
android:layout_height="fill_parent"
android:gravity="top|start"
android:hint="@string/ingredientsHint"
android:inputType="textAutoCorrect|textMultiLine"/>我在这里试过android:imeOptions="flagForceAscii“,但不起作用
问题示例:复制和粘贴:
2 aubergines, cut into ½ cm thick slices
8 tbsp olive oil, plus extra for the dish来自https://www.bbcgoodfood.com/recipes/roasted-vegetable-lasagne
结果导致以下内容被粘贴到
2 aubergines

, cut into ½ cm thick slices
8 tbsp olive oil

, plus extra for the dish发布于 2020-06-19 21:12:16
试试这个:
android:digits="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"您可以在此处输入您希望接受的任何字符。
https://stackoverflow.com/questions/62469628
复制相似问题