Semiconductor materials with sufficiently wide band gaps are urgently desired for use in solar-blind ultraviolet detectors. In this work, the growth of AlSnO films was achieved through the magnetron sputtering technique. AlSnO films with band gaps in the range of 4.40-5.43 eV were obtained by varying the growth process, which demonstrates that the band gap of AlSnO is continuously tunable. What is more, based on the films prepared, narrow-band solar-blind ultraviolet detectors were fabricated with good solar-blind ultraviolet spectral selectivity, excellent detectivity, and narrow full widths at half-maximum in the response spectra, showing a great potential to be applied to solar-blind ultraviolet narrow-band detection. Therefore, based on the results above, this study focusing on the fabrication of detectors via band gap engineering can be a significant reference for researchers interested in solar-blind ultraviolet detection.