An ambient light detection method, applied to an electronic device comprising a display screen, wherein a first ambient light detection unit and a second ambient light detection unit are disposed in the electronic device, a first photosensitive area of the first ambient light detection unit is used to detect intensity of first light, a second photosensitive area of the second ambient light detection unit is used to detect intensity of second light, the first light comprises ambient light and leaked screen light, and the second light comprises the leaked screen light; a calibration coefficient is configured in the electronic device based on a dark field calibration coefficient and a bright field calibration coefficient, wherein the calibration coefficient is used to indicate a relationship between intensity of the ambient light and each of a first value and a second value, the first value is an output value of the first ambient light detection unit in response to the first light, and the second value is an output value of the second ambient light detection unit in response to the second light; the electronic device determines the intensity of the ambient light based on the first value, the second value, and the calibration coefficient; wherein the dark field calibration coefficient is obtained through dark field calibration; and the dark field calibration comprises: controlling, by the electronic device in a dark field environment, a display screen of the electronic device to display a first interface, wherein no ambient light exists in the dark field environment; obtaining a third value output by the first ambient light detection unit and a fourth value output by the second ambient light detection unit; and obtaining the dark field calibration coefficient based on the third value and the fourth value, and wherein before the controlling, by the electronic device, a display screen of the electronic device to display a first interface, the method further comprises controlling, by the electronic device, the display screen of the electronic device to be off; and determining, by the electronic device, that a current environment is the dark field environment when the output value of the first ambient light detection unit and/or the output value of the second ambient light detection unit are/is less than a dark field threshold. a first ambient light detection unit and a second ambient light detection unit are disposed in the electronic device, a first photosensitive area of the first ambient light detection unit is used to detect intensity of first light, a second photosensitive area of the second ambient light detection unit is used to detect intensity of second light, the first light comprises ambient light and leaked screen light, and the second light comprises the leaked screen light; a calibration coefficient is configured in the electronic device based on a dark field calibration coefficient and a bright field calibration coefficient, wherein the calibration coefficient is used to indicate a relationship between intensity of the ambient light and each of a first value and a second value, the first value is an output value of the first ambient light detection unit in response to the first light, and the second value is an output value of the second ambient light detection unit in response to the second light; the electronic device determines the intensity of the ambient light based on the first value, the second value, and the calibration coefficient;