parent
b52f631643
commit
bff2d327b2
|
|
@ -50,7 +50,7 @@ fun HomeBanner(
|
||||||
Image(
|
Image(
|
||||||
painter = fallback,
|
painter = fallback,
|
||||||
contentDescription = null,
|
contentDescription = null,
|
||||||
contentScale = ContentScale.FillWidth,
|
contentScale = ContentScale.Crop,
|
||||||
modifier = modifier.fillMaxWidth().aspectRatio(aspectRatio),
|
modifier = modifier.fillMaxWidth().aspectRatio(aspectRatio),
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
|
|
@ -92,7 +92,8 @@ fun HomeBanner(
|
||||||
placeholder = fallback,
|
placeholder = fallback,
|
||||||
error = fallback,
|
error = fallback,
|
||||||
fallback = fallback,
|
fallback = fallback,
|
||||||
contentScale = ContentScale.FillWidth,
|
// 等比缩放并居中裁切,图片比例不同时也铺满整个 banner。
|
||||||
|
contentScale = ContentScale.Crop,
|
||||||
modifier = Modifier.fillMaxSize().clickable(
|
modifier = Modifier.fillMaxSize().clickable(
|
||||||
interactionSource = pressSource,
|
interactionSource = pressSource,
|
||||||
indication = null,
|
indication = null,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue