A method for adjusting a window, comprising: in response to detecting a first operation for triggering a specified position of the window, obtaining, by an electronic device, at least one candidate proportion of the window based on a type of the window, and obtaining an actual proportion of the window, wherein the actual proportion of the window obtained varies with the first operation; in response to detecting a second operation for stopping triggering the window, obtaining, by the electronic device, a difference between the at least one candidate proportion and the actual proportion, and determining a candidate proportion with the smallest difference as a target proportion; and adjusting, by the electronic device, a proportion of the window from the actual proportion to the target proportion; characterized in that, obtaining at least one candidate proportion of the window comprises: in response to the type of the window being not a type of game window or a type of video full screen window, obtaining attribute information of the window; in response to the attribute information meeting a first set condition, determining that the window corresponds to a landscape screen mode and the candidate proportion of the window is a first proportion; in response to the attribute information meeting a second set condition, determining that the window corresponds to a portrait screen mode and the candidate proportions of the window are a second proportion and a third proportion; in response to the attribute information not meeting the first set condition or the second set condition, determining that the candidate proportions of the window are the first proportion, the second proportion and the third proportion; wherein the first proportion, the second proportion and the third proportion are preset in a native scheme in an Android system of the electronic device to enable an application in the window to adapt to the Android system. in response to detecting a first operation for triggering a specified position of the window, obtaining, by an electronic device, at least one candidate proportion of the window based on a type of the window, and obtaining an actual proportion of the window, wherein the actual proportion of the window obtained varies with the first operation; in response to detecting a second operation for stopping triggering the window, obtaining, by the electronic device, a difference between the at least one candidate proportion and the actual proportion, and determining a candidate proportion with the smallest difference as a target proportion; and adjusting, by the electronic device, a proportion of the window from the actual proportion to the target proportion; characterized in that, obtaining at least one candidate proportion of the window comprises: in response to the type of the window being not a type of game window or a type of video full screen window, obtaining attribute information of the window; in response to the attribute information meeting a first set condition, determining that the window corresponds to a landscape screen mode and the candidate proportion of the window is a first proportion; in response to the attribute information meeting a second set condition, determining that the window corresponds to a portrait screen mode and the candidate proportions of the window are a second proportion and a third proportion; in response to the attribute information not meeting the first set condition or the second set condition, determining that the candidate proportions of the window are the first proportion, the second proportion and the third proportion; wherein the first proportion, the second proportion and the third proportion are preset in a native scheme in an Android system of the electronic device to enable an application in the window to adapt to the Android system. in response to the type of the window being not a type of game window or a type of video full screen window, obtaining attribute information of the window; in response to the attribute information meeting a first set condition, determining that the window corresponds to a landscape screen mode and the candidate proportion of the window is a first proportion; in response to the attribute information meeting a second set condition, determining that the window corresponds to a portrait screen mode and the candidate proportions of the window are a second proportion and a third proportion; in response to the attribute information not meeting the first set condition or the second set condition, determining that the candidate proportions of the window are the first proportion, the second proportion and the third proportion; wherein the first proportion, the second proportion and the third proportion are preset in a native scheme in an Android system of the electronic device to enable an application in the window to adapt to the Android system.