안녕하세요 초보 안드로이드 개발자입니다.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.neonex.nsok.activity.MainActivity">
<android.support.v4.widget.SwipeRefreshLayout
android:id="@+id/swipe_container"
android:layout_width="match_parent"
android:layout_height="match_parent">
<WebView
android:id="@+id/nsok_webView"
android:layout_width="wrap_content"
android:layout_height="match_parent" />
</android.support.v4.widget.SwipeRefreshLayout>
</LinearLayout>
소스와 같이 아래로 당겨서 swipe 기능 때문에 swipeRefresh 안에다가 webview를 넣었습니다.
그런데 잘 동작을 하는 듯 하다가 웹 내에서 메인화면 scroll 이외의 lefemenu 펼친 후 leftmenu 스크롤을 하면
그 이후부터 터치를 어딘가에 뺏긴 것 같이 동작합니다. 위쪽으로 스크롤하면 웹화면이 올라가는게 아니고 새로고침이 되어버립니다.
새로고침은 웹화면이 젤 상단에 있을때 아래로 당겨서 동작해야하는데..
말씀드린대로 leftMenu를 꺼내 아래로 스크롤 후 웹 화면을 상단으로 다시 스크롤 해보면 웹 화면이 중간에 있는데도 웹 화면이 상단으로 이동하지 않고 새로고침이 되어버립니다.
해결책으로 NestedscrollView 가 있는 거 같아 위 소스의 Webview를 NestedscrollView로 감싸봤습니다.
이번에는 웹화면의 LeftMenu를 열면 이 메뉴가 자신의 길이보다 더 많이 스크롤이 됩니다.
다른 화면들을 들어가도 풋터를 지나쳐서 더 많이 스크롤이 되는 현상이 발생합니다..
그리고 webview 높이를 wrap_content 로 설정하니까 딱 맞게 나오긴 하지만 leftMenu를 꺼내면 화면이 사라집니다..
두서없고 스크린샷첨부도 없어서 죄송합니다..