问题描述
我有一张包裹ListTile的卡片的ListView,在每个列表磁贴中都有标题和副标题,我尝试在多部手机(android/ios)上调试我的应用程序.对于这些电话中的某些电话,因为字幕屏幕较小,所以字幕文本会使卡窗口小部件溢出.有没有一种方法可以根据屏幕大小有效地适合我的文本小部件?
I have a ListView of cards wrapping a ListTile, inside each list tile I have title and a subtitle, I tried to debug my app on several phones (android/ios). For some of theses phones, the subtitle text overflows the card widget because they have smaller screen. Is there a way to effectively fit my text widgets according to screen size ?
推荐答案
问题是您正在使用ListTile来处理不属于他们的内容.
The problem is that you're using ListTile for stuff they are not made for.
根据material.io,一个listTile最多 3行文本. https://material.io/guidelines/components/lists.html#lists-用法
A listTile, according to material.io, is at most 3 lines of text.https://material.io/guidelines/components/lists.html#lists-usage
请改用适合内容的卡片.
Use a card instead, which fits the content.
这篇关于如何自动缩放窗口小部件以适合不同的屏幕尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!