The denial of a visit to the White House by the Warriors was not the first time the president tried to pre-empt a snub by dealing one of his own; last month, he abruptly announced that he was disbanding two of his business advisory councils after some members said they would resign from them to protest his equivocating response to racially charged violence in Charlottesville, Va., at a march organized by neo-Nazis and white supremacists.

At the Alabama rally, Mr. Trump said the protests at football games would stop if fans left when players did not stand for the anthem. “The only thing you could do better is if you see it, even if it’s one player, leave the stadium,” he said.

With the N.F.L. struggling to make the game safer in light of scores of players who have been found to have severe brain damage from hard hits, Mr. Trump complained that the game was being ruined by referees trying to control unnecessarily rough tackles.

“Today if you hit too hard — 15 yards! Throw him out of the game!’’ he said, adding: “They’re ruining the game! They’re ruining the game. That’s what they want to do. They want to hit. They want to hit! It is hurting the game.’’