The rapid development of organic-inorganic hybrid perovskite solar cells has recently attracted the worldwide attention because their power conversion efficiency has risen from 4% to higher than 20% within just six years. It is well known that the perovskite materials with APbI3 crystal structure have a 3D framework of corner-sharing PbI6 octahedra, in which each Pb atom bonds with six I atoms, and the A cations fill in the octahedral interstices. At present, a lot of researches have focused on the synthesis and doping modification of perovskite materials. However, it is hard to detect directly the weak interactions between A cations and PbI6 skeleton in the APbI3 crystal structure through experiments, which have effect on the structural stability and electronic properties. To provide a full understanding of the interplay among size, structure, and organic/inorganic interactions, the stability, electronic structures and optical properties of APbI3 (A denotes Cs+, NH4+, MA+, FA+) were investigated by the plane-wave ultra soft pseudo potentials. Two dispersion corrections were taken into account in the weak interactions between A cations and PbI6 skeleton in the APbI3 crystal structure, respectively. The results show that the type and size of cations affect the distortion of PbI framework, indicating that the larger the radius of the A cation is, the stronger the interaction between the A cation and the PbI framework is. Further, it is identified that after geometry relaxation, the orientation of A cations (A denotes NH4+, MA+, FA+) is easy to change, and the PbI frameworks present structural distortion. CsPbI3 is more stable energetically than other three kinds of perovskite materials. For the PbI6 octahedra, the large dipole moments of 0.23D and 0.32D for the generalized-gradient approximation method or 0.28D and 0.29D for the local-density approximation method are also present in MAPbI3 and FAPbI3, respectively. In addition, the energy band structures, which affect the generation and migration of photon-generated carriers and optical properties, will alter with the structural distortion of PbI frameworks. By analyzing the energy band structures and corresponding density of states, we find that four systems have similar band structures near the Fermi energy, namely, the top of valance band is mainly contributed by I 5p orbitals, while the bottom of conduction band is dominated by Pb 6p orbitals and partly contributed by I 5p orbitals. A little difference of their electronic structures and optical absorption spectra originates from the distortion of PbI6 octahedra in APbI3 crystal structures. It is noted that the contribution of the ions Cs+ and FA+ on the top of valance band is slightly larger than that of the ions NH4+ and MA+. Compared with other three kinds of perovskite materials, CsPbI3 presents the narrowest direct band gap, the lowest effective carrier mass and excellent visible-light and infrared absorption. The results may provide some theoretical guidance for further research on perovskite materials in the application of solar cells.