Abstract:
The present disclosure relates to a sensor network, Machine Type Communication (MTC), Machine-to-Machine (M2M) communication, and technology for Internet of Things (IoT). The present disclosure may be applied to intelligent services based on the above technologies, such as smart home, smart building, smart city, smart car, connected car, health care, digital education, smart retail, security and safety services. A method and an electronic device for displaying a virtual keyboard are provided. The method includes detecting a touch on a virtual keyboard, determining whether the detected touch moves from a first area within the virtual keyboard to another area, and changing and displaying, when the touch moves from the first area to the other area, the virtual keyboard according to a movement direction of the touch.