If you become sunburned, you must cover up (but it is better to avoid getting too much sun as it is very dangerous.
Some clubs will not accept a partial cover up ie. a shirt but no bottom. If in doubt, consult local rules.