All the chemicals used in this work were analytical reagent grade and they were used as received without further purification. The electrolyte for preparing TiO2 nanotube arrays was using ammonium fluoride, ethylene glycol and deionized water. And the cadmium nitrate, stannous chloride and sodium sulfide solutions were using absolute ethyl alcohol. Experimental reagents were shown in Table 1