0
전체 화면으로 확장하려는 WebView가 있습니다. 사용자는 그것과 상호 작용할 것이므로 확장 될 때 어떤 종류의 상태를 유지해야합니다.Android보기 계층 구조 작동 방법
- Remove WebView from its parent
- Put WebView at the top of the current View hierarchy with `FILL_PARENT` for width and height
나중에 내가 다시 넣어 WebView를해야합니다 : 이상적인 프로세스는이이
- Remove WebView from top of the hierarchy
- Restore the old hierarchy
- Put WebView back where it was with its previous setting for width and height
I에 대한 getRootView
을 알고,하지만 나는 그것을 사용하는 방법을 모르겠어요. DecorView
은 무엇입니까?
위에서 설명한 확장 및 축소 동작을 수행 할 수있는 샘플 코드가 있다면 누구나 감사하게 생각합니다. 감사!
View webViewParent = (View) webView.getParent();
webViewParent.removeView(webView);
가에서 WebView
을 넣어 :
parentViewGroup.removeViewAt(0);
는 부모로부터 WebView
을 제거
ViewGroup parentViewGroup = (ViewGroup) webView.getRootView().findViewById(android.R.id.content);
View rootview = parentViewGroup.getChildAt(0);
그 루트 뷰를 제거