You may use talcum powder to stop spandex from riding up. Buying shorts with elasticated leg holes, folding the edges, or sewing any extra fabric can also make spandex fit better.