A novel ultraviolet photochemical method was used to prepare amorphous TiO2 resistive-switching films at low temperature. The ratio of on-state to off-state currents was measured, and a good value of 103 was obtained. The resistive switching behavior of the flexible device remained stable after 600 cycles of electrical switching, and 1000 cycles of bending. Using the same method, we also prepared ZrO2 flexible films with a high ratio of 104 of on-state and off-state resistance. Especially, due to the fact that the precursor solution of ZrO2 are photosensitive to UV light of 325-365nm, we obtained ZrO2 arrays on the PET/ITO substrate using a method combined with UV exposure, solvent rinsing and UV photolysis processes. The ZrO2 arrays showed excellent resistive properties, stable resistive switching behavior after being bent for 103 times, and showed stable flexibility up to a minimum bending diameter of 1.25cm.