新旧Android版本之间的Android应用差异

时间:2019-07-11 21:21:42

标签: android android-studio

我有一个使用Android Studio构建的旧应用程序。 现在,在安装所有Android Studio更新,将应用程序重构并迁移到Android X之后,照片会弯腰显示在Android 7.1.1、8、9中。但是在Android 6中,该应用程序应能正常运行。

这是调试日志:

import React, { useState } from "react"

const Test = () => {
  // How many hearts do you want to show?
  const numberOfHearts = 5

  // Start with no hearts filled in
  const [likeValue, setLikeValue] = useState(0)

  const handleClick = (heartValue) => {
    setLikeValue(heartValue)
    // Update your database with the new value of likes
  }

  // Loop to show as many hearts as you set above
  const hearts = [...Array(numberOfHearts).keys()].map((v) => {
    // v is 0 for the first, 1 for the second, etc
    return (
      <Heart
        isLiked={likeValue > v}
        key={v}
        heartValue={v + 1}
        handleClick={handleClick}
      />
    )
  })

  return <div>{hearts}</div>
}

const Heart = ({ handleClick, heartValue, isLiked }) => {
  return (
    <button onClick={() => handleClick(heartValue)}>
      <i className={isLiked ? "fas fa-heart" : "far fa-heart"} />
    </button>
  )
}

有人可以指出我在哪里寻找问题以及如何解决它。

在此先感谢您的帮助!

0 个答案:

没有答案