Skip to content

Commit b2154f2

Browse files
committed
Limit maximum size of image in RecommendedSubjectsVerticalGrid to improve performance on ios
1 parent 1f51720 commit b2154f2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

app/shared/ui-exploration/src/commonMain/kotlin/ui/exploration/recommend/RecommendedSubjectsVerticalGrid.kt

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ package me.him188.ani.app.ui.exploration.recommend
1111

1212
import androidx.compose.foundation.layout.Box
1313
import androidx.compose.foundation.layout.PaddingValues
14+
import androidx.compose.foundation.layout.sizeIn
1415
import androidx.compose.foundation.lazy.grid.GridItemSpan
1516
import androidx.compose.foundation.lazy.grid.LazyGridScope
1617
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
@@ -98,6 +99,7 @@ private fun RecommendedSubjectCard(
9899
onClick = onClick,
99100
modifier = modifier,
100101
shape = shape,
102+
imageModifier = Modifier.sizeIn(maxWidth = 300.dp, maxHeight = (300f / 9 * 16).dp), // 限制最大宽度, 可以让 iOS 不卡一点
101103
)
102104
}
103105

0 commit comments

Comments
 (0)