An electronic device comprising: a first housing; a second housing foldably connected with the first housing; a flexible display disposed on the first housing and the second housing; at least one sensor; a memory; and at least one processor operatively connected to the flexible display, the at least one sensor, and the memory, wherein the at least one processor is configured, when instructions stored in the memory are executed, to: control the flexible display to display a first execution screen of an application when the first housing and the second housing are in an unfolded state, wherein the first execution screen includes a preview screen captured by a camera, a plurality of first UI elements above the preview screen and a plurality of second UI elements below the preview screen, wherein the application includes a camera application, wherein the application is configured to change an execution screen based on an angle between the first housing and the second housing changing and falling within a predetermined range of a partially folded state, wherein the angle between the first housing and the second housing is identified using the at least one sensor, and wherein the application is configured to change the execution screen according to the change in the angle by controlling the flexible display to display a second execution screen of the application associated with the predetermined range instead of the first execution screen, wherein the second execution screen includes the preview screen captured by the camera on a first portion of the flexible display corresponding to the first housing, and to display, below the preview screen, the plurality of first UI elements and the plurality of second UI elements on a second portion of the flexible display corresponding to the second housing. a first housing; a second housing foldably connected with the first housing; a flexible display disposed on the first housing and the second housing; at least one sensor; a memory; and at least one processor operatively connected to the flexible display, the at least one sensor, and the memory, control the flexible display to display a first execution screen of an application when the first housing and the second housing are in an unfolded state, wherein the first execution screen includes a preview screen captured by a camera, a plurality of first UI elements above the preview screen and a plurality of second UI elements below the preview screen, wherein the application includes a camera application, wherein the application is configured to change an execution screen based on an angle between the first housing and the second housing changing and falling within a predetermined range of a partially folded state, wherein the angle between the first housing and the second housing is identified using the at least one sensor, and wherein the application is configured to change the execution screen according to the change in the angle by controlling the flexible display to display a second execution screen of the application associated with the predetermined range instead of the first execution screen, wherein the second execution screen includes the preview screen captured by the camera on a first portion of the flexible display corresponding to the first housing, and to display, below the preview screen, the plurality of first UI elements and the plurality of second UI elements on a second portion of the flexible display corresponding to the second housing.