An atomically thin two-dimensional (2D) covalent organic framework (COF) was successfully synthesized via the photon-assisted imine condensation reaction within 1 h from the highly uniform and homogeneous precursor solution layer floating on the water surface. The polarity optimization of the precursor solution was the key step for the successful formation of the high-quality 2D COF because only the precursor solution consisting of polarity-controlled solvents allows ideal floating on the water surface. The polarity-controlled solution not only prohibits the agglomeration of the organic precursors on the water surface but also facilitates the wafer scale and layer number-controllable synthesis of the 2D COF. The resulting 2D COF has a uniform porous structure and highly oriented layered structure along the out-of-plane direction as observed by microscopy analysis and X-ray diffraction, respectively. In addition, we successfully fabricated field effect transistor type polyimine-based COF (pi-COF) electronic devices to demonstrate the prompt electrical responses to photo-exposure and water vapor exposure, suggesting the potential applications of the pi-COF in electrical photodetector or moisture-detector devices.