Apple has done it again. This is yet another ingenious innovation for their newest version of the iPhone 3G. NOTE: This tutorial should work with all iPhones, but is guaranteed to work with the 3G model, v2.0 and higher.
If you've got SMS preview turned on, this is what you should see while your phone is locked when you receive a message:
To change this, start by unlocking your phone and opening the settings app:
Once here, you'll need to touch "General" then "Passcode Lock":
Next, you will be asked to put in a 4-digit passcode. If you don't want a passcode, choose something easy for now, like 0000:
On the next screen that appears after you type your code in, you'll see the option titled "Show SMS Preview". Slide it into the "On" position:
If you didn't want a passcode, you can set your iPhone to not lock until the phone has been idle for a certain period of time. This means that even if you hit the top button, you will not have to type in a passcode until the specified time period has passed. Select "Require Passcode" and set the desired interval.
So there you have it! Now when you receive text messages, you'll see something like this:
Thanks for reading and good luck!