2013-08-06 115 views
2

我正在使用CommonsWare的Android CWAC-Camera Library並試圖將我自己的用戶界面用於相機片段。請原諒我,如果這是一個愚蠢的問題。我正在關注README文件,特別是以下部分:「鏈接到超類」是什麼意思?

「您可以繼承CameraFragment並覆蓋onCreateView()。鏈接到超類以獲取CameraFragment自己的UI,然後將其包裝到自己的容器中並使用其他小部件,然後返回從你的onCreateView()組合的UI。「

有沒有人使用過這個,可以提供一個例子?謝謝!

回答

4

他們的意思是這樣:

public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { 
    View camera = super.onCreateView(inflater, container, savedInstanceState); 

    // wrap camera in some other container that you inflate or instantiate 

    return yourView; 
} 
+0

準確地說,雖然我編輯你的答案就擺在正確的參數。 – CommonsWare

+0

thx,寫出我的頭 –

+0

啊好的!感謝您的幫助,並感謝CommonsWare爲優秀的圖書館服務! –