조각을 사용하는 응용 프로그램이 있습니다. 이 중 하나는 부분적으로 생성 된 HTML 컨텐트를 보여주는 WebView 조각입니다. 크기는 다를 수 있지만 너무 크지는 않습니다 (1-30kb). 사용자가 하나의 프래그먼트에서 버튼을 클릭하면 (FragmentA가되도록) 해당 WebView 프래그먼트 (FragmentB)로 변경해야합니다.웹뷰 내용의 사전 렌더링 및 prescroll
How is it going now:
1. Instaniate FragmentB
2. replace FragmentA with FragmentB (user sees blank white screen)
3. FragmentB loads generated html, render it (user sees top of html)
4. Page scrolls down with webView.pageDown(true) (calling it from opPageFinished()) (user sees scrolling animation to the bottom of the page)
How i want it to be:
1. Instaniate FragmentB
2. set it to some invisible container (user still have FragmentA on the screen)
3. it renders html, scrolls it down (same)
4. when page is ready, rendered and scrolled down I hide FragmentA and show FragmentB
어떻게하면 좋을까요? 필자가 설명한 두 번째 알고리즘을 시도했지만 WebView가 렌더링하려는 내용과 \ 그 내용이 사용자에게 표시 될 때까지 내용을 스크롤하지 않았습니다.
나는 당신과 똑같이 직면했다. fragmentB를 인스턴스화 할 때로드 스피너를 생성 한 다음 url을로드 할 수 있습니다. 그런 다음 WebViewClient.onPageFinished 콜백을 사용하여 회 전자를 숨기고 웹보기를 표시합니다. 나는 당신이 여전히 빠른 빈 페이지를 보게 될 것이라고 말하지만, 스피너가없는 경우보다 더 받아 들일 수있다. –