An X-ray imaging device, comprising: an X-ray source arrangement for providing an X-ray beam; at least one grating (13, 14); and a line detector with a plurality of sensor lines, which sensor lines are each provided by a plurality of sensor elements, and which sensor lines are provided for detecting respective portions of the X-ray beam passing the at least one grating during operation; wherein the X-ray imaging device is arranged for moving the line detector and an object to be imaged relative to each other, such that in response to the portions of the X-ray beam a number of interference patterns are detectable at respective different relative positions of the line detector and the object for reconstructing an image of the object; wherein the at least one grating (13, 14) comprises at least one first segment and at least one second segment arranged adjacent to each other in a direction perpendicular to the direction of the line detector; and wherein the X-ray imaging device is arranged for moving the line detector and the at least one grating relative to each other between at least a first relative position and a second relative position, such that in the first relative position, a portion of the X-ray beam during operation passes through the at least one first segment and subsequently arrives at the one-dimensional sensor line for detection, while the at least one second segment is arranged outside said portion of the X-ray beam such that it projects along the X-ray beam onto the area between neighboring sensor lines, and that in the second relative position, said portion of the X-ray beam during operation passes through the at least one second segment and subsequently arrives at the one-dimensional sensor line for detection, while the at least one first segment is arranged outside said portion of the X-ray beam such that it projects along the X-ray beam onto the area between neighboring sensor lines. an X-ray source arrangement for providing an X-ray beam; at least one grating (13, 14); and a line detector with a plurality of sensor lines, which sensor lines are each provided by a plurality of sensor elements, and which sensor lines are provided for detecting respective portions of the X-ray beam passing the at least one grating during operation; wherein the X-ray imaging device is arranged for moving the line detector and an object to be imaged relative to each other, such that in response to the portions of the X-ray beam a number of interference patterns are detectable at respective different relative positions of the line detector and the object for reconstructing an image of the object; wherein the at least one grating (13, 14) comprises at least one first segment and at least one second segment arranged adjacent to each other in a direction perpendicular to the direction of the line detector; and wherein the X-ray imaging device is arranged for moving the line detector and the at least one grating relative to each other between at least a first relative position and a second relative position, such that in the first relative position, a portion of the X-ray beam during operation passes through the at least one first segment and subsequently arrives at the one-dimensional sensor line for detection, while the at least one second segment is arranged outside said portion of the X-ray beam such that it projects along the X-ray beam onto the area between neighboring sensor lines, and that in the second relative position, said portion of the X-ray beam during operation passes through the at least one second segment and subsequently arrives at the one-dimensional sensor line for detection, while the at least one first segment is arranged outside said portion of the X-ray beam such that it projects along the X-ray beam onto the area between neighboring sensor lines.