One-dimensional (1D) nano-arrays can reduce light reflection loss, suppress recombination dynamics, guide charge carrier transport, andrelax stress and strain in flexibleoptoelectronic devices, to improve optoelectronic function and stability under aging and mechanical bending. However, in-situ fabrication of 1D nano arrays on polymer-based flexible electrodes is challenging, mainly due to degradation of the flexibleelectrodes at high temperature of in situgrowth. Here, nanopillar arrays (NaPAs) made of diverse inorganic materials, such as Ti, TiO2, SnOx(functioning aselectron transporting layers) and NiOx (serving as hole transporting layers), are deposited onto a flexible electrode by glancing angle deposition (GLAD), to create perovskite solarcells (PSCs) and photodetectors. As-grown NaPAs enhance light transmittance, facilitate light harvesting in perovskite, promote charge carrier transport and collection, and facilitate the formation of large perovskite grains. All these features lead to high efficiency of >20% and >17% for the rigidand flexible PSCs, respectively. No obvious crack nucleation is formed on the NaPAs after 500 bending, resulting in good mechanic stabilityof the photovoltaic performance. Furthermore, compared to the conventional mesoporous counterparts, metallic oxideNaPAsenable the perovskite photodetectors to comprehensively enhance the detection speed, responsivity, and detectivity, and to extend the linear dynamic range. We devise an advanced technique of low substrate-temperature GLAD generally adapted to in-situ deposition of charge carrier transporting layers made of inorganicNaPAs on flexible electrodes, to significantly enhance optoelectronic performanceof flexible devices.