All-inorganic perovskite CsPbIBr2 materials are promising for optoelectronics, owing to their upgraded ambient stability and suitable bandgap. Unfortunately, they generally undergo severe halide phase segregation under illumination, which creates many iodide-rich and bromide-rich domains coupled with significant deterioration of their optical/electrical properties. Herein, we propose a facile and effective strategy to overcome the halide phase segregation in the CsPbIBr2 film by modifying its crystalline grains with poly(methyl methacrylate) (PMMA) for the first time. Such a strategy is proceeded by covering a PMMA layer on the substrate before deposition of the CsPbIBr2 film. Further investigations manifest that the CsPbIBr2 film with PMMA possesses larger grains, better crystallinity, and fewer traps than the one without any modification. Moreover, it holds the nearly eliminated halide phase segregation. Therefore, the carbon-based, all-inorganic CsPbIBr2 perovskite solar cell exhibits the much suppressed photocurrent hysteresis, coupled with an outstanding efficiency of 9.21% and a high photovoltage of 1.307 V.