레아웃은 대충 이렇습니다.
<RelativeLayout>
<GridView>
</GridView>
<Button>
</Button>
</RelativeLayout>
하려고 하는것은 GridView가 footer를 지원 안하기에... button을 invisible 과 visible로 보였다 안보였다 하려 합니다.
그리드뷰는 항상 전체 화면이어야 하고 스크롤로 끝가지 내렸을때 버턴을 보이게 해야 합니다.
grid의 스크롤을 끝까지 내렸을때 리스너를 받아서 보였다 안보였다는 성공했는데....
문제는 버튼이 Grid위에 덮힌다는 겁니다. ㅠ.ㅠ
RelativeLayout 이기에 버튼에 below를 쓰면 될줄 알았는데... GridView가 fill_parent 이기 때문에 안보이더군요
자리를 안차지 한다는 gone를 써 봤는데... 이것 역시 안보이더라구요...
뭔가 다른 방법이 있을까요?
방법이야 많이 있습니다.
위에분처럼 하셔도 될듯 하구요....layout_weight 를 사용하셔도 됩니다.
예를 들어...
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<GridView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_weight="1"
....
/>
<Button
android:layout_width="fill_parent"
android:layout_height="40dp"
....
/>
</LinearLayout>
@낵교
@푸른바람
두분께 감사합니다.. 낵교님 방법으로해서 얼추비슷하게 됐습니다.
아쉬운건... 버튼을 클릭하고 이벤트를 실행후엔... 버튼의 위치가 공백으로 남아 있네요...gone를 써도 공백이 남아있다는....
이상한건... 이게 지금 탭에 있는데.. 탭을 한번 전환해서 갔다오면.. 공백이 없어진다는....좀더 삽질을 해봐야겠습니다.
아무튼... 바쁜가운데 덧글을 써주신 위 두분게 감사 드립니다.




<RelativeLayout>
<Button
android:"@+id/btn"
android:layout_alignParentBottom="true">
</Button>
<GridView>
android:layout_above="@id/btn"
</GridView>
</RelativeLayout>