args[1] = attrs; final View view = constructor.newInstance(args); if (view instanceof ViewStub) { // Use the same context when inflating ViewStub later. final ViewStub viewStub = (ViewStub) view; viewStub.setLayoutInflater(cloneInContext((Context) args[0])); } return view; //異常處理 ....
View bestView = getBestView(candidateViews, requestedMediaTypes, attrs); //獲得正確的View if (bestView != null) { return bestView; } } 3) 如何定制:我們可以自己給容器中添加一個視圖解析器;自動的將其組合進來; 2. Support for serving static resources, including support for WebJars (see below)...
params = root.generateLayoutParams(attrs); if (!attachToRoot) { // Set the layout params for temp if we are not // attaching. (If we are, we use addView, below) temp.setLayoutParams(params); } } if (DEBUG) { System.out.println("---> start inflating children"); } // Inflate...