The animation on the iphone essentially works by caching the look of the screen each time it's drawn into internally stored bitmaps. When the screen rotates, flips etc. it is actually these cached images which are used in the animation, and the screen itself is not redrawn until the animation is finished.
If you're seeing a black border around your screen, it might be because you're drawing one. However, you may just be describing the normal rotation animation of any app - there is a black background displayed behind the rotated image/cached view as it rotates, because during the rotation there are points where the rotating square shape can't fill the screen to the corners. This black background, as far as I know, is a design decision made by Apple and there isn't a way for developers to change the color.