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;
    }

 

posted @ 2014-01-18 22:41  无忧之路  阅读(1460)  评论(0编辑  收藏  举报
无忧之路