Wearing a face mask, Mr Xi also visited a community health centre, where he had his temperature checked.
More than 900 people have been killed by the virus, the gravest public health crisis in China since Sars in 2002-3.
During his visit, Mr Xi urged "more decisive measures" to combat the virus.
The Chinese leader has kept a low profile over weeks as the outbreak has worsened. He is yet to visit Wuhan, where the virus first emerged.
The death last week of a doctor in the city who tried to warn colleagues about the virus, but was targeted by authorities, sparked an outpouring of grief and anger on social media, much of it directed against Mr Xi's government.
"We want freedom of speech" was among the hashtags that trended but were quickly censored.
China's leadership had already faced accusations of downplaying the severity of the virus - and initially trying to keep it secret.
The government has admitted some "shortcomings and deficiencies" in its response but the World Health Organization (WHO) has praised its efforts to control the virus, including quarantines on a massive scale.
On Monday a WHO expert team arrived in China to investigate the outbreak following nearly two weeks of negotiations with Beijing. The organisation now says the fatality rate for the virus appears to be about 2%.
What did Xi do?
The Chinese leader on Monday visited Ditan hospital in Beijing, where coronavirus patients are being treated. He also took part in a video chat with medical workers in Wuhan.
Images carried by state media showed Mr Xi wearing a mask and having his temperature checked. He was also pictured chatting to people clutching grocery bags and wearing masks outside a community centre, joking that they should probably not shake hands at this "special time".
"We must have confidence that we will eventually win this battle against the epidemic," he was quoted as telling hospital workers.
The virus has tested China's ruling Communist Party - which Mr Xi leads - and its authoritarian political system, where local officials are often afraid to speak out about problems for fear of upsetting their party superiors.