In this kind of problems you must try to "think" like the computer does and go through all the code you have that may affect the result of the code.
For example the shaking of the screen when following player is most usually caused by the screen moving over the coordinates it is supposed to move to and then getting back but because the speed is too high it goes too much back and it won't settle down, but instead shake around the position it is supposed to move to.
Like:
Your view moves with speed 5 pixels / frame, so yvelocity = 5.
If it should stop to y coordinate 17 and it is currently in y coordinate 15 it will jump to 20 and then it will think "oh I'm too far", go 5 pixels back to 15 and think again "oh I'm too far", etc.

To avoid this make it either slow down its speed when it's closer or make the point where you want the view to go to have a bigger area around it where it can stay. So like that it can stop even 3 pixels away from the target. That way you can avoid the shaking.
That was just an example, but do this, put yourself to the place of the computer and try to think what happens if you carefully follow the rules you've given in your code
