How to add click action for the ImageSpan

后端 未结 5 756
我寻月下人不归
我寻月下人不归 2020-12-15 06:56

I have a ImageSpan set in the TextEdit. And I want to add the action - when user click on the ImageSpan, it will popup a dialog and show the big image.

I checked the

5条回答
  •  春和景丽
    2020-12-15 07:39

    I have found the key point。 In order to response to click action, we not only set clickablespan , but also set edittext'setMovementMethod, the code is like this:

    EditText.setMovementMethod(LinkMovementMethod.getInstance());
    

    Here is the problem. If set setMovementMethod to LinkMovementMethod.getInstance(), the edittext's cursor will be gone. I don't know why

提交回复
热议问题