2 Ways:
When creating your spline you can have this automatic using this setting:
https://ibb.co/8mWwNbV
If you have a collapsed spline or cylinder you can always select one of the edges and press this button in the unwrap window to do the same thing:
https://ibb.co/HrFXLCp