You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An AMTagView named as tag1. The text for the tag is "Custom" and it has an accessory image. Below is the code for tag creation and adding it to tagListView:
We use setupText: or setTagText: to modify the text for the tag that has already been added. Since the tag has already been added, we don't use addTagView: method and hence the above calculation doesn't happen.
As a workaround, I am adding and removing the tag after modifying the text so that it maintains the same padding.
Is this the expected behavior?
The text was updated successfully, but these errors were encountered:
I am not changing the order of the tags. I just change the text of the tag on tap. For sample purpose, I didn’t even change the text length. I use the exact same text that it already has and I still see the frames changing and tag becoming a little more wider. I did try calling rearrange but it doesn’t help.
I have added a gif that shows the problem (be patient with the gif)
Ok, I see the problem, when the tag is rendered the second time, it takes the options set in the appearance proxy. It happens in the demo too, if you tap the other tags they all inherit the X icon, since it was set in the appearance proxy last.
Lets say I have a below setup:
So when the tag list view shows up on screen, the frame of the tag1:
{{10, 39}, {82, 29}}
I wrote a tap handler which does nothing but just resets the text to same text. Code below:
If I check the frame after setTagText, it shows up as
{{211, 0}, {106, 30}}
This happens because when we use addTagView to add tag to the tagListView, the addTagView method recalculates the width of the tag as shown below:
We use setupText: or setTagText: to modify the text for the tag that has already been added. Since the tag has already been added, we don't use addTagView: method and hence the above calculation doesn't happen.
As a workaround, I am adding and removing the tag after modifying the text so that it maintains the same padding.
Is this the expected behavior?
The text was updated successfully, but these errors were encountered: