Two-dimensional (2D) inverse opal (IO) TiO2 films, synthesized by colloidal crystal templating, such as polystyrene (PS) spheres, are particularly interesting because of their potential applications in sensors, solar cells, and electrochromic devices. For these applications, high crystallinity is essential for device performance. Usually, to achieve the IO structure with high crystallinity, the PS opal template is first removed by calcination at a temperature of similar to 400 degrees C, and subsequently to crystallize amorphous TiO2, a temperature higher than 400 degrees C is needed. This results in cracks and collapse of the macroporous framework. Furthermore, this route is limited to thermally stable substrates, such as glass, which is a significant drawback as the increasing development of technologies and modern electronics requires the design of inexpensive, lightweight, and efficient optoelectronic devices on flexible substrates. In order to circumvent these problems, we developed a 'dynamic-hard-template' infiltration strategy for the fabrication of large-area crack-free nanocrystalline (NC) anatase 2D-TiO2 IO films on rigid transparent conducting substrates and on ITO coated flexible polyethyleneterephthalate (ITO/PET) substrates, by using various sizes of PS spheres. According to this strategy, first a dynamic opal 2D film of PS spheres is self-assembled on the surface of water, followed by the infiltration of preformed anatase TiO2 nanoparticle sol from the bottom into the PS opal crystal as the guest material, thus eliminating the need for high temperature crystallization. The obtained floating PS/TiO2 opal composite film is deposited on ITO-coated glass and ITO/PET substrates. An optimized low temperature chemical method is adopted to remove the PS template to yield NC anatase 2D-TiO2 IO films. The films obtained on ITO/PET substrates were successfully used as an active electrode in the fabrication of a flexible electrochromic device.