The optical fiber relative humidity sensor based on Nafion-crystal violet film was developed. The effect of samples temperature in the range from 299.15 K to 324.15 K on the sensing performance of the sensor was investigated. The mathematical function between temperature and the sensitivity of the sensor was established according to the reactive theory of sensor to the relative humidity, which was validated with the experiment. With the research, the application range of the sensor was extended, which made the sensor keep a good veracity when it was used in situ.