제대로 이해했다면이 XML 레이아웃을 사용하여 원하는 것을 얻을 수 있습니다 (또는 프로그래밍 방식으로 동일한 구조체를 구축 할 수 있음).
NestedScrollView 내부의 ViewGroup 하단에 드로어 블이있는 ImageView를 "src"로두기 만하면됩니다 (ScrollView는 하나의 자식 만 가질 수 있음). ViewGroup이 내부에 있고 ScrollView 뒤에 내용이있는 이미지가있는 ScrollView를 얻을 수 있습니다.
사용자가 콘텐츠 아래쪽으로 스크롤하면 이미지가 아래쪽에서 나타납니다. 아래 코드에서 XML을 보여주고 앱의 배경과 스크롤 뷰의 아래쪽 위치 및 콘텐츠 배치 위치를 보여줍니다. 당신이 바닥 에있는 이미지 대신 아래의있는 ScrollView 내용 뒤에 표시 할 경우
<?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"
android:background="@drawable/app_background">
<!-- YOU CAN SET YOUR APP BACKGROUND COLOR OR DRAWABLE UP HERE -->
<android.support.v4.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<!-- YOUR CONTENT GOES HERE -->
<TextView android:text="Your content here instead of this TextView"
android:layout_width="match_parent"
android:layout_height="1500dp" />
<!-- YOUR FOOTER IMAGE HERE -->
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/trees" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</LinearLayout>
, 당신은 위의 XML에 이미지 뷰를 제거 필요하고, 대신 는받는 당김 배경을 설정 NestedScrollView 내부에있는 LinearLayout, 그리고 배경으로 다음과 같은 XML 리소스 드로어 블을 사용
<?xml version="1.0" encoding="utf-8"?>
<bitmap
xmlns:android="http://schemas.android.com/apk/res/android"
android:src="@drawable/trees"
android:gravity="bottom|center_horizontal" />
이 XML이 배경으로 설정하면 뷰의 하단에 정렬 새로운 드로어 블을 생성합니다. 그냥 당김 폴더에 trees_background.xml이라는 XML 파일에서 해당 코드를 저장하고, 그런 다음 수는 다음과 같은 방법으로 NestedScrollView의 바닥에 도달하지 않았거나 여부를 검색 할 수 있습니다
원하는 동작의 일부 gif 또는 비디오 예제를 첨부 할 수 있습니까? – Gaket