MicrosoftDocs / AdaptiveCards

Docs for Adaptive Cards
https://docs.microsoft.com/en-us/adaptive-cards/
Creative Commons Attribution 4.0 International
72 stars 139 forks source link

Poor performance on image and video #171

Open Wenfengcheng opened 5 years ago

Wenfengcheng commented 5 years ago

We are trying to use AdaptiveCards intergrating bot service on app, but when displaying images or videos is too slow to render. And will these images be cached? How can I use AdaptiveCards on UITableViewCell to dynamically change the height?


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

matthidinger commented 5 years ago

Hi there, I assume you're using the iOS renderer? Can you include an exam JSON paypoad to help us debig? What size are the images and videos, and does the performance hit happen as they are appearing/disappearing (perhaps in a scroll view of some kind) or something else?

Wenfengcheng commented 5 years ago

Hi @matthidinger , I'm using sample JSON file on AdaptiveCards Samples, I try to intergrate all samples json to a single page not in a scrollview, but it takes too long to render ImageGallery, Input Form, etc...

But I aslo try to render AdaptiveCards on UITableViewCell, actually rendering performance is worse. How to solve the problem of slow rendering, and how to change the style of some of the controls(such as video).

jwoo-msft commented 4 years ago

Sample App doesn't cache images. they are loaded from URLs. you can cache images locally in your app, and have your resource resolver to point to the local cache. Please take a look at Visualizer codes for resolver implementation. For UITableViewCell's dynamic height, you just need to follow the instruction here. https://developer.apple.com/library/archive/documentation/UserExperience/Conceptual/AutolayoutPG/WorkingwithSelf-SizingTableViewCells.html. Some of the controls can be styled by XIB. Please check at iOS native styling. If it's empty, it will updated in a day or so.