He said he didn't like McCain after he lost to Barack Obama in the 2008 presidential election, because he didn't like "losers".
When McCain died in 2018, Trump refused to lower the White House flag back to half-staff, even though it's become customary for presidents to sign a proclamation calling for the flag to remain at half-staff for members of congress until the day of interment, Business Insider's John Haltiwanger reported.
Months later, Trump still wasn't over it in March 2019, and during a speech in Ohio, he said he'd "had to give" McCain a funeral he wanted. "I don't care about this, I didn't get 'thank you.' That's OK," he said. "We sent him on the way, but I wasn't a fan of John McCain."
Trump continued his attacks criticizing him again in March 2019, for the role he played in the investigations into whether Russia influenced the 2016 election. "Spreading the fake and totally discredited Dossier 'is unfortunately a very dark stain against John McCain,'" he tweeted, referring to McCain's decision in December 2016 to turn the dossier containing salacious (and largely uncorroborated) intel about Trump over to the FBI.