You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Jetpack Compose中SVG转XML后边缘像素化/锯齿问题求助

Android Compose Logo 显示锯齿/像素化问题排查

操作背景

在Android Studio中将SVG格式的Logo转换为XML格式,由于Android不支持#pattern语法,将原SVG中的Fill="#pattern"替换为FillColor,个人判断该操作并非问题诱因,但需告知此修改。

异常现象

Logo在不同设备/模拟器上显示效果不一致:

  • 6.5英寸真机:画质显示正常
  • 5.7英寸真机:出现明显锯齿边缘
  • 6.7英寸模拟器:存在像素化模糊问题

相关Compose代码

Image(
    imageVector = ImageVector.vectorResource(id = R.drawable.logo_white),
    contentDescription = "logo_white",
    contentScale = ContentScale.Fit,
    modifier = Modifier
        .offset(y = 90.dp)
        .sharedElement(
            state = rememberSharedContentState(key = "logo_white"),
            animatedVisibilityScope = animatedVisibilityScope,
            boundsTransform = { _, _ -> tween(durationMillis = 1000) }
        )
)

恳请帮忙排查此问题。

内容的提问来源于stack exchange,提问作者StonedCodingTom

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.21 14:54:50