Let's say a Claydoll was battling with a Clefable with spikes in play, if Clefable uses gravity and Claydoll's levitate is neutralized would spikes affect in the middle of the battle or would it have to switch in to be hurt?
It would not damage the Pokemon on the turn Gravity is used, only when a Pokemon switches in.
It would have to switch in. Hope this helped!