android 在fragment中获取界面的UI组件

 @Override

    public View onCreateView(LayoutInflater inflater, ViewGroup container,

                             Bundle savedInstanceState) {

        View view = inflater.inflate(R.layout.wei_xin_fragment, container, false);

        button = (Button) view.findViewById(R.id.press_button);

        registerForContextMenu(button);

        return view;

    }

 

你可能感兴趣的:(Fragment)