2017-04-07 109 views
-2

我不知道在標記的onCreateView()方法的容器參數來自哪裏,有一個ViewGroup的活動有這個片段或別的東西?我不知道那是因爲我不知道是什麼的ViewGroup片段是XML吸引到這個代碼.thanks您的時間Android的片段容器參數在onCreateView

public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, Bundle savedInstanceState) { 


    return inflater.inflate(R.layout.fragment_list,container,true); 



} 

回答

0

傳遞給onCreateView()的容器參數父ViewGroup中(從活動的佈局)在其中你的片段佈局將被插入。 其餘你可以參考這個link

相關問題