0
我想自定義操作欄添加到一個片段按鈕ID沒有在自定義操作欄獲得
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// TODO Auto-generated method stub
View view = inflater.inflate(R.layout.fragment_createblog, container,false);
android.app.ActionBar actionBar = getActivity().getActionBar();
actionBar.setCustomView(R.layout.actionbar_createblog);
actionBar.setDisplayShowCustomEnabled(true);
actionBarBlogCreation = (Button) view.findViewById(R.id.button_actionbarBlog);
actionBarBlogCreation.setOnClickListener(this);
}
});
我動作條被改變,但是當我試圖從佈局走按鈕ID它顯示爲空。爲什麼會發生?