마스터Q&A
접속유지
가입하기
안드로이드 Q&A
최근 질문
미답변 질문
태그
사용자
질문하기
마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다.
안드로이드펍
에서 운영하고 있습니다. [
사용법
,
운영진
]
인기있는 태그
초보어플개발
(3427)
안드로이드스튜디오
(2664)
안드로이드-초보어플개발
(1333)
안드로이드-스튜디오
(1086)
도와주세요-
(995)
이미지
(970)
listview
(866)
리스트뷰
(844)
오류
(805)
레이아웃
(693)
fragment
(675)
webview
(670)
listview 높이 조절 에따른 문제
0
추천
동적으로 리스트에 아이템을 추가하고있는데요 리스트뷰 밑에 버튼을 넣을경우 아이탬이 적을 경우는 상관없는데 아이템이 많아지면 버튼이 사라집니다.
엑티비티는 다이얼로그 형식으로 만들었는데 동적으로 추가되다가 일정 아이템이상이들어오면 스크롤되도록 변경 하는 방법이 있나요??
listview
안드로이드
루운
(
1,160
포인트)
님이
2014년 2월 25일
질문
Please
log in
or
register
to add a comment.
답변 달기
·
글에 소스 코드 보기 좋게 넣는 법
·
질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
답변이 채택되거나 답변에 댓글이 달리면 이메일로 알려드립니다:
답변이 채택되거나 댓글이 달리면 이메일로 알려드립니다
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면
로그인
하거나 혹은
가입
하세요.
2개의 답변
0
추천
채택된 답변
이렇게 하시면 될것같습니다~
<LinearLayout
......
android:orientation="vertical"
>
<ListView
...........
android:layout_height="0dp"
android:weight="1"
/>
<Button
..............
/>
</LinearLayout>
주드로
(
590
포인트)
님이
2014년 2월 25일
답변
루운
님이
2014년 3월 3일
채택됨
똑같이해봤는데 일정 이상 아이템이 늘어나면 버튼이 사라지네요 ㅠㅠ 왜이러지..
작성하신 xml코드를 볼 수 있나요?
보여주시면 수정해드릴게요~
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="
http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@color/background_color"
android:orientation="vertical" >
<RelativeLayout
android:id="@+id/root_ra01"
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<LinearLayout
android:id="@+id/liner01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/category_title"
android:orientation="horizontal" >
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="5dp"
android:layout_marginLeft="15dp"
android:layout_marginTop="5dp"
android:text="@string/app_name"
android:textColor="@android:color/white"
android:textSize="20dp" />
</LinearLayout>
<RelativeLayout
android:id="@+id/liner02"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/liner01"
android:minHeight="45dp" >
<TextView
android:id="@+id/title_devices"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:paddingLeft="12dp"
android:paddingRight="50dp"
android:text="@string/select_device"
android:textColor="@android:color/holo_blue_light"
android:textSize="20dip" />
<ImageView
android:id="@+id/about"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:src="@android:drawable/ic_menu_info_details" />
</RelativeLayout>
</RelativeLayout>
<TextView
android:id="@+id/empty"
android:layout_width="wrap_content"
android:layout_below="@id/root_ra01"
android:layout_height="wrap_content"
android:gravity="center"
android:minHeight="60dp"
android:padding="10dp"
android:text="@string/scanning" />
<RelativeLayout
android:id="@+id/liner03"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/empty"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/linearLayout01"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ListView
android:id="@+id/new_devices"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:stackFromBottom="true" />
</LinearLayout>
<LinearLayout
android:id="@+id/root_ra02"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearLayout01"
android:background="@drawable/button_bg"
android:gravity="center" >
<Button
android:id="@+id/btn_cancel"
style="?android:attr/buttonBarButtonStyle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/button_cancel" />
</LinearLayout>
</RelativeLayout>
</RelativeLayout>
이런식으로 되어 있습니다
liner03 레이아웃이 RelativeLayout이네요. 저걸 LinearLayout으로 바꿔주시면 됩니다.
답변을 빨리 해드려야하는데 늦었네요 ㄷㄷ
Please
log in
or
register
to add a comment.
0
추천
리스트뷰의 영역을 초과하면 스크롤이 자동으로 생성될텐데요.
리스트뷰의 아래에 버튼을 넣고 싶으시면
Main 레이아웃에서 리스트뷰의 Height 속성을 줄이고 (dp로 지정) 그 밑에 버튼을 넣으세요
초보개발자ㅠ
(
33,870
포인트)
님이
2014년 2월 25일
답변
동적으로 할당할수 있는방법을 생각중이라서요 ㅠ 답변 감사합니다
Please
log in
or
register
to add a comment.
...