At the Granite City Works on Thursday, Donald J. Trump was the only thing bigger than U.S. Steel.

With his obligatory attacks on the news media, his leisurely digressions into his 2016 election victory, his professions of affection for strongmen like Kim Jong-un of North Korea, and the thumping classic-rock soundtrack, Mr. Trump could have been at one of his political rallies.

Still, the president’s trip to the Midwest on Thursday, which included a stop in Iowa, also cast a light on farmers, whose soybean exports dried up after China struck back over the tariffs. While praising President Xi Jinping as a friend and a “great guy,” he said China was punishing farmers so it could continue its longstanding practice of stealing technology from American companies.

“We will not give China or any other country a veto on United States national security,” Mr. Trump said. “And we will not let anybody ruin our wonderful American farmers.”

Pressure from farmers played a role in Mr. Trump’s decision to call a truce in a trade war with the European Union this week. He hailed the agreement under which it agreed to buy more soybeans — as part of a package that could allow the Europeans to avoid tariffs on automobiles — and offered rare praise for a European leader, Jean-Claude Juncker of the European Commission.

But farmers are not the only ones suffering because of the tariffs. The Mid Continent Nail Corporation in Poplar Bluff, Mo., which ships in steel from Mexico, warns it is on the brink of extinction, after being forced to raise the price of its nails. It has lost half of its orders and has laid off 60 of its 500 workers.