Mr. Trump first became aware of the negative headlines watching television aboard Air Force One, and bellowed at the small coterie of advisers traveling with him, including Mick Mulvaney, his acting chief of staff. He was especially upset after he saw footage of a news conference held by Senator Sherrod Brown, Democrat of Ohio, and Mayor Nan Whaley of Dayton, a Democrat, but no positive images of himself while visiting Dayton’s Miami Valley Hospital. Not long afterward, his aides began distributing photos and video of the president at the hospital flanked by selfie-taking doctors and nurses…

Aides have long said that Mr. Trump is heavily reactive to news coverage, and when he does something that he believes he should have been praised for — such as Wednesday’s visits to the cities — he grows furious when he does not receive accolades. But he has not adjusted his often casual approach to tragedy, including his penchant for flashing a thumbs-up sign in photographs…

Part of the concern that some of Mr. Trump’s advisers had heading into Wednesday was that the president would veer off script, and they wanted to make the visits as brief as possible, said those familiar with what took place.