We study the azimuthal angle distribution of pions using a hadronic transport model for relativistic heavy-ion collisions. It is found that the strength of the azimuthal anisotropy strongly depends on the transverse momentum of pions and the centrality of the reaction. The mechanism of the azimuthal anisotropy is found to be the shadowing effect of the spectator through both pion reabsorptions and rescatterings.