An electronic device, comprising: a memory and a processor, wherein the processor is coupled to the memory; and the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: displaying a desktop or a lock screen on a display of the electronic device in response to a received first user operation, and playing a first transition animation in an order from the initial image frame to the last image frame (1502; 1702) of the first transition animation on the desktop or the lock screen; switching from the desktop or the lock screen to a screen off screen (1503; 1703) on the display of the electronic device in response to a received second user operation, wherein before the switching from the desktop or the lock screen to the screen off screen (1503; 1703), the first transition animation is played to a first image frame on the desktop or the lock screen, and the first image frame is any image frame after the initial image frame of the first transition animation; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation on the screen off screen (1503; 1703); wherein the screen off screen (1503; 1703) comprises a first display box, a size of the first display box is smaller than a size of the screen off screen (1503; 1703), and the first display box is at a first position of the display; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation in the first display box. a memory and a processor, wherein the processor is coupled to the memory; and the memory stores program instructions, and when the program instructions are executed by the processor, the electronic device is caused to perform the following steps: displaying a desktop or a lock screen on a display of the electronic device in response to a received first user operation, and playing a first transition animation in an order from the initial image frame to the last image frame (1502; 1702) of the first transition animation on the desktop or the lock screen; switching from the desktop or the lock screen to a screen off screen (1503; 1703) on the display of the electronic device in response to a received second user operation, wherein before the switching from the desktop or the lock screen to the screen off screen (1503; 1703), the first transition animation is played to a first image frame on the desktop or the lock screen, and the first image frame is any image frame after the initial image frame of the first transition animation; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation on the screen off screen (1503; 1703); wherein the screen off screen (1503; 1703) comprises a first display box, a size of the first display box is smaller than a size of the screen off screen (1503; 1703), and the first display box is at a first position of the display; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation in the first display box. displaying a desktop or a lock screen on a display of the electronic device in response to a received first user operation, and playing a first transition animation in an order from the initial image frame to the last image frame (1502; 1702) of the first transition animation on the desktop or the lock screen; switching from the desktop or the lock screen to a screen off screen (1503; 1703) on the display of the electronic device in response to a received second user operation, wherein before the switching from the desktop or the lock screen to the screen off screen (1503; 1703), the first transition animation is played to a first image frame on the desktop or the lock screen, and the first image frame is any image frame after the initial image frame of the first transition animation; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation on the screen off screen (1503; 1703); wherein the screen off screen (1503; 1703) comprises a first display box, a size of the first display box is smaller than a size of the screen off screen (1503; 1703), and the first display box is at a first position of the display; and playing the first transition animation in an order from the first image frame to the initial image frame of the first transition animation in the first display box.