在Fragment中,因为继承的父类的不同,导致在Fragment中无法获取到控件的id,此时,只要在获取findviewbyid前加上 getView()就可以了。 转载于:https://www.cnblogs.com/yandashan666/p/10419467.html