[英]How to make text stay inside a div box and continue on next line when it reaches the edge of div box?
[英]is it possible to have content break to next line with flex when content reaches edge inside of FlatList
我是react-native的新手,我試圖創建一個組件,並嘗試使用FlatList在其上傳遞道具。 但是,FlatList在垂直或水平視圖上顯示,當視圖到達邊緣時,我需要在下一行中顯示視圖。 但是我找不到任何解決方案。
data={data}
//Optional
// horizontal={true}
// numColumns={4}
renderItem={({ item }) => (
<TrendingTopicsDesign image={item.imageuri} title={item.title} />
)}
keyExtractor={(item, index) => index.toString()}
我希望我的觀點到達邊緣時會破裂
您可以使用css display:flex
然后使用flex-wrap: wrap;
在父元素上,這將迫使子元素移至下一行
您可以使用flex-wrap: wrap;
CSS屬性flex-wrap: wrap;
連同display: flex;
屬性,使子項在到達屏幕邊緣時顯示在下一行。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.