I'm using Unity, that's how it works there.
There is a component on canvas called "canvas scaler". By default the scale mode in it is set to "constant pixel size". All you have to do is change it to "scale with screen size" and put the current screen size as a reference.