An X-ray imaging apparatus and an imaging method capable of acquiring an image of a test object associated with a phase shift in consideration of X-ray absorption is provided. A splitting element configured to spatially split an X-ray into multiple X-ray beams is provided. A shielding unit including a plurality of shielding elements configured to block part of an X-ray acquired by the splitting element is provided. Part of X-ray beams detected at the first detection pixels is blocked by the shielding elements. The X-ray beams detected by the second detection pixels adjoining the first detection pixels are not blocked by the shielding elements.