Hydrogels are widely used in biomedicine, wearable electronics and other fields due to their flexibility and high water content. However, hydrogels prepared by traditional methods generally suffer from swelling in humid environments, which greatly limits their development. This is because most hydrogels are prepared in a non-swollen equilibrium state. This work introduces a method based on directional crystallization to adjust the mechanical and anti-swelling properties of γ-polyglutamic acid/polyvinyl alcohol (γ-PGA/PVA) hydrogels. The results show that the directional crystallization method can effectively improve the antiswelling performance of the hydrogel. After the directional crystallization process for three times, the γ-PGA/PVA hydrogel can remain stable in HCl-Tris solution up to 2 months, indicating its good anti-swelling properties. The morphology, structure and molecular composition of γ-PGA/PVA hydrogels were systematically studied, and their anti-swelling mechanism was also investigated. In addition, the γ-PGA/PVA hydrogel exhibits good response to human motion, opening up new avenues in the field of wearable sensors.