The effects of the UV background radiation on the formation of sub-galactic clouds are studied by means of one-dimensional hydrodynamical simulations. The radiative transfer of the ionizing photons due to the absorption by HI, HeI and HeII, neglecting the emission, is explicitly taken into account. We find that the complete suppression of collapse occurs for the clouds with circular velocities typically in the range V c ∼ 15 − 40 km s −1 and the 50% reduction in the cooled gas mass with V c ∼ 20 − 55 km s −1 . These values depend most sensitively on the collapse epoch of the cloud, the shape of the UV spectrum, and the evolution of the UV intensity. Compared to the optically thin case, previously investigated by Thoul & Weinberg (1996), the absorption of the external UV photon by the intervening medium systematically lowers the above threshold values by ∆V c ∼ 5 km s −1 . Whether the gas can contract or keeps expanding is roughly determined by the balance between the gravitational force and the thermal pressure gradient when it is maximally exposed to the external UV flux. Based on our simulation results, we discuss a number of implications on galaxy formation, cosmic star formation history, and the observations of quasar absorption lines. In Appendix, we derive analytical formulae for the photoionization coefficients and heating rates, which incorporate the frequency/direction-dependent transfer of external photons.