Wilise is correct in asking what effect you are going for. If the cylinder is vertical then gravity can be used. However if it is horizontal, then you need either air forcing it back, or springs etc.
Additionally, there needs to be a way for the air to escape from the cylinder. 3 and 4 way valves have exhausts built in so that the air can exit. If you use a 2 way valve, then there needs to be an exhaust in the line between the valve and the cylinder. You can use something as simple as a small hole in the line, or even an irrigation drip valve.
Here is a link for some additional information on cylinders and valves that may be of help:
Pneumatic Index