提问人:Aqib Javid Bhat 提问时间:11/17/2023 更新时间:11/17/2023 访问量:19
ColorFilter 在释放模式下不适用
ColorFilter not applying in release mode
问:
当我通过 USB 安装该应用程序时,它工作正常,并且按预期应用了颜色过滤器,但是当我尝试生成已签名的 apk 并安装相同的 apk 时 - 颜色过滤器不适用。
/**
* Represents a square on the Tic Tac Toe game board.
* @param markImg The image resource ID for the mark (X or O) to be displayed in the square.
* @param onSquareClick A function to be invoked when the square is clicked.
* @param modifier The modifier to be applied to the square.
*/
@Composable
fun Square(
@DrawableRes markImg: Int?,
onSquareClick: () -> Unit,
modifier: Modifier = Modifier
) {
Surface(
modifier = Modifier
.size(dimensionResource(id = R.dimen.card_size_lg))
.padding(dimensionResource(id = R.dimen.padding_medium)),
shadowElevation = dimensionResource(id = R.dimen.card_elevation),
shape = RoundedCornerShape(16.dp)
) {
Column(
modifier = modifier
.fillMaxSize()
.clickable { onSquareClick() },
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
markImg?.let {
Image(
painter = painterResource(id = markImg),
contentDescription = null,
modifier = modifier
.padding(dimensionResource(id = R.dimen.padding_large)),
colorFilter = ColorFilter.tint(color = MaterialTheme.colorScheme.onBackground)
)
}
}
}
}
我重构了我的代码以简化井字游戏的状态 - https://github.com/aqib-m31/Tic-Tac-Toe-App 我生成了一个 apk 文件,但 playstore 显示应用程序未安装,当我填写 Play Protect 申诉表时,发布了 apk 文件,但它没有显示正确的颜色。我无法弄清楚为什么会发生这种情况。
答: 暂无答案
评论