Search

CN-121996336-A - Method and related device for displaying skeleton screen

CN121996336ACN 121996336 ACN121996336 ACN 121996336ACN-121996336-A

Abstract

The application discloses a method and a related device for displaying a skeleton screen. The application relates to the technical field of computers, in which an electronic device can receive a user operation for loading and displaying an interface a in the triggering of this time. The electronic device may then display a skeleton screen, which may be derived based on the interface information of the last trigger-loaded displayed interface a. Finally, the electronic equipment displays the interface a. Therefore, the electronic equipment can not display a white screen or display a white screen for a very short time in the process from triggering the display interface to the final display interface, and the user experience is improved.

Inventors

  • YANG QI
  • DONG XINRAN
  • SHI WEIYAN
  • TIAN DEYU
  • LI DAWEI
  • MA YUN

Assignees

  • 华为技术有限公司
  • 北京大学

Dates

Publication Date
20260508
Application Date
20241108

Claims (16)

  1. 1. A method of displaying a skeletal screen, the method being applied to an electronic device, the method comprising: responding to a first operation of a user, and displaying a first user interface of an application, wherein the first operation is used for cold starting the application; And acquiring a first skeleton screen corresponding to the first user interface according to first interface information of the first user interface, wherein the first skeleton screen is used for displaying the first user interface before the first user interface is displayed again after the application is started again in a cold mode, and the first interface information comprises one or more of the number of elements included in the first user interface, the size, the position, the label and the content of each element in the first user interface.
  2. 2. The method of claim 1, wherein prior to said displaying the first user interface of the application in response to the first operation by the user, the method further comprises: and responding to the first operation of the user, displaying a preset second skeleton screen, wherein the second skeleton screen is different from the first skeleton screen.
  3. 3. The method according to claim 1 or 2, characterized in that the method further comprises: storing the first skeleton screen; And responding to the operation of cold starting the application again by the user, and displaying the stored first skeleton screen.
  4. 4. A method according to claim 3, wherein after said displaying the stored first skeletal screen in response to a user's operation to cold start the application again, the method further comprises: responsive to a user's operation to cold start the application again, displaying the first user interface again; Acquiring a third skeleton screen corresponding to the first user interface according to the second interface information of the first user interface displayed again, wherein the second interface information comprises one or more of the following elements included in the first user interface displayed again, the size, the position, the label and the content of each element in the first user interface displayed again; storing the third skeleton screen; and displaying the stored third skeleton screen in response to the operation of cold starting the application by the user again.
  5. 5. A method according to claim 3, wherein after said displaying the stored first skeletal screen in response to a user's operation to cold start the application again, the method further comprises: responsive to a user's operation to cold start the application again, displaying the first user interface again; Acquiring a third skeleton screen corresponding to the first user interface according to the second interface information of the first user interface displayed again, wherein the second interface information comprises one or more of the following elements included in the first user interface displayed again, the size, the position, the label and the content of each element in the first user interface displayed again; storing the third skeleton screen when the third skeleton screen is different from the first skeleton screen; and responding to the operation of cold starting the application again by the user, and displaying the stored third skeleton screen.
  6. 6. The method of any one of claims 1-5, wherein the first skeletal screen displays one or more of a number of placeholders contained by the first skeletal screen, a size, a location, a pattern of each placeholder in the first skeletal screen, The step of obtaining a first skeleton screen corresponding to the first user interface according to the first interface information of the first user interface specifically includes: determining the number of placeholders in the first skeleton screen according to the number of elements in the first user interface, Determining the size of placeholders in the first skeleton screen according to the size of elements in the first user interface, Determining the position of the placeholder in the first skeleton screen according to the position of the element in the first user interface, And determining the style of the placeholder in the first skeleton screen according to one or more of the size, the label and the content of the element in the first user interface.
  7. 7. The method of claim 6, wherein determining the size of the placeholder in the first skeletal screen according to the size of the element in the first user interface comprises: the sizes of placeholders corresponding to elements in the same element group are all set to the same size.
  8. 8. The method of claim 6, wherein determining the size of the placeholder in the first skeletal screen according to the size of the element in the first user interface comprises: The size of the placeholders corresponding to the elements in the first element group is set to be a first size, wherein the first size is an average value of the sizes of a plurality of elements in the first element group, or the size of one element in the first element group.
  9. 9. The method according to any one of claims 6-8, wherein determining the location of the placeholder in the first skeletal screen from the location of the element in the first user interface comprises: determining the position of the first placeholder according to the position of the first element; The positions of the placeholders positioned in the same row among the plurality of placeholders corresponding to the elements in the same element group are adjusted to be aligned, and the positions of the placeholders positioned in the same column are adjusted to be aligned.
  10. 10. The method according to any one of claims 6-9, wherein prior to said obtaining a first skeleton screen from obtaining first interface information from said first interface information, the method further comprises: Dividing elements included in the first user interface into a plurality of element groups; the determining the style of the first placeholder according to one or more of the size, the label and the content of the first element specifically comprises setting the styles of the placeholders determined based on the elements in the same element group as the first style.
  11. 11. The method of any of claims 7-10, wherein a plurality of elements in a same element group have a same label and a similarity between the plurality of elements in the same element group is greater than a first threshold.
  12. 12. The method of claim 4 or 5, wherein after displaying the stored first skeletal screen in response to the user's operation to cold start the application again, the method further comprises, prior to displaying the first user interface again in response to the user's operation to cold start the application again: determining that loading of the second interface information is completed; and stopping displaying the first skeleton screen.
  13. 13. The method of any of claims 3-5, wherein prior to the displaying the stored first skeletal screen in response to a user again cold starting the application's operation, the method further comprises: A second operation is received and a second operation is performed, Responding to the second operation, and adjusting the style of the first skeleton screen to a first style; the first skeleton screen for displaying and storing specifically comprises: and displaying the first skeleton screen of the first style.
  14. 14. An electronic device comprising a memory, a processor, and computer instructions stored on the memory, the processor executing the computer program to implement the method of any one of claims 1-13.
  15. 15. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-13.
  16. 16. A computer program product comprising computer instructions which, when executed by a processor, implement the method of any one of claims 1-13.

Description

Method and related device for displaying skeleton screen Technical Field The application relates to the technical field of computers, in particular to a method for displaying a skeleton screen and a related device. Background In some scenarios, the electronic device may display the skeletal screen during interface loading. The skeleton screen reflects the structure of the interface with completed subsequent loading, and can relieve the waiting feeling of the user. The acquisition of the skeleton screen requires a certain time, so that the electronic device may display a white screen for a period of time before displaying the skeleton screen, which affects the user experience. How to improve the user experience during interface loading is a problem that needs to be addressed in the art. Disclosure of Invention The application provides a method and a related device for displaying a skeleton screen, which can display the skeleton screen as early as possible, so that a user observes a white screen in less time, and the user experience is improved. In a first aspect, the application provides a method for displaying a skeleton screen, which is applied to electronic equipment, and comprises the steps of responding to a first operation of a user, displaying a first user interface of the application, wherein the first operation is used for cold starting the application, acquiring the first skeleton screen corresponding to the first user interface according to first interface information of the first user interface, wherein the first skeleton screen is used for displaying the first user interface again after cold starting the application again before the first user interface is displayed again, and the first interface information comprises one or more of the number of elements included in the first user interface, the size, the position, the label and the content of each element in the first user interface. By implementing the method, the first skeleton screen can be displayed immediately after the operation of the cold start application is received again. In the process from the operation of re-receiving the cold start application to the process of re-displaying the first user interface, the white screen is not displayed or the white screen is displayed for a very short time, so that the user experience is improved. And the first skeleton screen is obtained based on the first interface information, and the first skeleton screen can accurately reflect the layout structure of the first user interface. Therefore, the waiting feeling of the user can be relieved through the structure of informing the interface in advance, and the user experience is improved. With reference to the first aspect, in some implementations, before the displaying the first user interface of the application in response to the first operation of the user, the method further includes displaying a preset second skeletal screen in response to the first operation of the user, the second skeletal screen being different from the first skeletal screen. The preset second skeleton screen may be server-generated. In the development stage, the server designs and makes a first user interface, and at this time, the server generates a second skeleton screen based on the related content of the first user interface. The second skeleton screen may be sent to the electronic device by the server when the electronic device installs the application to which the first user interface belongs, or may be sent to the electronic device by the server when the first user interface is first opened. In this way, the skeleton screen may also be displayed before the electronic device first opens the first user interface. With reference to the first aspect, in some implementations, the method further includes storing the first skeletal screen and displaying the stored first skeletal screen in response to a user's operation to cold start the application again. Different user interfaces may have skeleton screens corresponding thereto. The first skeleton screen stored in the electronic device can carry the identification of the first user interface, so that the first skeleton screen can be accurately read from the storage module when the skeleton screen corresponding to the first user interface needs to be displayed subsequently. In combination with the first aspect, in some implementations, after displaying the stored first skeleton screen in response to the user's operation to cold start the application again, the method further includes displaying the first user interface again in response to the user's operation to cold start the application again, obtaining a third skeleton screen corresponding to the first user interface based on second interface information of the first user interface displayed again, where the second interface information includes one or more of a number of elements included in the first user interface displayed again, a size, a location, a tag, and content