One of the most important things you have to do when you are learning how to play the Ukulele and Guitar is having your hand and fingers in the right position.
Your hand should be in a position behind the neck of the guitar so that the fingers can curve around so that the fingertips can come straight down on the string. This is important so that none of the other strings are touched by that finger. In the case of the D7 chord - one of the fingers has to lay across all of the stings - so that rule doesn't count.
If your hand and fingers are right - it will make it easier to go from chord to chord - but you will discover that as you do it!