在fragment中无法直接使用findviewbyid的方法,需要先得到fragment的对象
View view = inflater.inflate(R.layout.
fragment_home
, container
, false)
;
得到view对象后才能使用
myView = (MyView) view.findViewById(R.id.activity_man_myview);