摘要：Gravity has an unavoidable effect on all living organisms inhabiting fluidic surroundings. To investigate the spatial distribution of bacteria in quiescent fluids and their rheotactic behavior in shear flows under buoyancy, we adjust the buoyant force to regulate bacterial swimming in a microfluidic channel. It is found that swimming bacteria of Escherichia coli exhibit an obvious vertical separation when exposed to a medium with high density and gradually gather close to the up wall within minutes. The bacterial population presents a net upward number flux, which enhances the trapping of motile bacteria onto the up surface as a result of buoyancy force apart from the hydrodynamic and kinematic interactions in quiescent fluids. When flow is imposed into the channel, the buoyancy effect is however significantly suppressed. Additionally, the drift velocity perpendicular to the buoyancy vector as a result of chirality-induced transverse swimming decreases with buoyancy force. However, this transverse drift capability is recovered after excluding the intrinsic swimming motility in a quiescent medium. Failing to escape from the trapping as a result of buoyant force allows for a facile separation of bacteria along the vertical direction. The findings also offer a controllable way to redisperse and homogenize the bacteria distribution close to walls by imposing a weak shear flow.