There is a single checkbox for enabling Stretch for SubviewportContainer. Turn the stretch on option for properties of SubviewportContainer.

There is no requirement of resizing code for Subviewport, only put Resizing for the SubviewportContainer which will manage the resizing of its child Subviewport.