An electronic device comprising: a display ; a communication circuit ; a control circuit ; and a memory electrically connected to the control circuit , wherein the memory stores instructions enabling the control circuit to: display, on the display of the electronic device , a content on a first layer; and based on an execution of a sharing function between the electronic device and an external device : display, on the display of the electronic device , an icon associated with controlling of the sharing function, the icon being displayed on a second layer that is different from the first layer, and transmit in a streaming mode, to the external device , data associated with the first layer including the content for simultaneously displaying on a display of the external device , without transmitting data associated with the second layer including the icon, wherein the control circuit is further configured to change the icon to a floating state based on a user input, wherein, when the icon is in the floating state, the icon is movable on the display based on a further user input. a display ; a communication circuit ; a control circuit ; and a memory electrically connected to the control circuit , wherein the memory stores instructions enabling the control circuit to: display, on the display of the electronic device , a content on a first layer; and based on an execution of a sharing function between the electronic device and an external device : display, on the display of the electronic device , an icon associated with controlling of the sharing function, the icon being displayed on a second layer that is different from the first layer, and transmit in a streaming mode, to the external device , data associated with the first layer including the content for simultaneously displaying on a display of the external device , without transmitting data associated with the second layer including the icon, wherein the control circuit is further configured to change the icon to a floating state based on a user input, wherein, when the icon is in the floating state, the icon is movable on the display based on a further user input. display, on the display of the electronic device , a content on a first layer; and based on an execution of a sharing function between the electronic device and an external device : display, on the display of the electronic device , an icon associated with controlling of the sharing function, the icon being displayed on a second layer that is different from the first layer, and transmit in a streaming mode, to the external device , data associated with the first layer including the content for simultaneously displaying on a display of the external device , without transmitting data associated with the second layer including the icon, wherein the control circuit is further configured to change the icon to a floating state based on a user input, wherein, when the icon is in the floating state, the icon is movable on the display based on a further user input. display, on the display of the electronic device , an icon associated with controlling of the sharing function, the icon being displayed on a second layer that is different from the first layer, and transmit in a streaming mode, to the external device , data associated with the first layer including the content for simultaneously displaying on a display of the external device , without transmitting data associated with the second layer including the icon, wherein the control circuit is further configured to change the icon to a floating state based on a user input, wherein, when the icon is in the floating state, the icon is movable on the display based on a further user input. <EOS>