We report a facile solution polymerized approach to prepare nanocomposite hydrogels. The electrostatic assembly of positive TiO2 nanoparticles with negative clay nanosheets obtained TiO2-clay composite particles, which was disassembled by the solution polymerization of N,N-dimethylacrylamide and homogeneously interacted with poly(N,N-dimethylacrylamide) chain to form nanocomposite hydrogels. The final nanocomposite hydrogels are mechanical tough and transparent, which has the maximum 598.21 KPa compressive strength. The immobilized TiO2 not only acted as the photo-initiator for radical polymerization but also endowed the nanocomposite gel films good UV protective performance. This strategy can be very useful for preparing nanocomposite hydrogels with different functions.