안드로이드 개발 질문/답변
(글 수 45,052)
페이스북의 댓글 xml과 동일한 형식으로 제작을 해볼려고하는데..문제가 있스니다.

위의 사진처럼 만들고싶은데..소스를 만지고 만지 만졌씁니다. 어찌어찌하여 내용과 스크롤뷰를 넣으면 밑에하단에 댓글다는곳이 움직이고, 내용과 스크롤뷰를 붙여서 하나로 만들면 하단에 고정이 따라서 움직이고..이건뭐...
<?xml version="1.0" encoding="UTF-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/mainColor2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RelativeLayout style="@style/topbar_layout" >
<ImageView
android:id="@+id/iv_talk"
style="@style/topbar_left_icon"
android:src="@drawable/button_talk" />
<ImageView
style="@style/topbar_center_icon"
android:src="@drawable/logo_chonan_ms" />
<ImageView
android:id="@+id/iv_setting"
style="@style/topbar_right_icon"
android:src="@drawable/button_go_setting" />
</RelativeLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/title_read" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background="#ffffff"
android:orientation="vertical" >
<TextView
android:id="@+id/writer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000" />
<TextView
android:id="@+id/writeday"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="#000000" />
<TextView
android:id="@+id/content"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="내용"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000000" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:paddingBottom="5dp"
android:paddingTop="5dp" >
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/icon_comment" />
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical" >
<ListView
android:id="@+id/listView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:cacheColorHint="#00000000"
android:divider="#ffffff"
android:dividerHeight="0px" >
</ListView>
</LinearLayout>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<!-- android:layout_marginBottom="70dip"> -->
<EditText
android:id="@+id/et_nickname"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.15"
android:textSize="13dp"
android:hint="닉네임"/>
<EditText
android:id="@+id/et_send"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="0.45"
android:textSize="14dp"
android:hint="댓글을 입력해 주세요." />
<ImageView
android:id="@+id/iv_submit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0"
android:src="@drawable/button_send" >
</ImageView>
</LinearLayout>
</LinearLayout>
이거은 관련 소스내용입니다.
신기한건 제가 생각한것처럼 댓글란의 하단을 레이아웃을 빼버리고 내용과 리스트뷰를 하나의 레이아웃으로 묵고 스크로류로해도 안됩니다. 여러방법을 했습니다. head,floot등등..근데 꼭 이걸하면 하단에 댓글다는것이 같이 움직이더라고요.
전체적으로보면 페이스북에서 뎃글다는 xml을 구현하고싶은데..아.꼭 조언좀 부탁드립니다.




예전에 저도 같은 고민을 하였는데 일단 ScrollView 안의 ListView 는 정상적으로 스크롤이 돼지 않더라구요
제가 한 방법으로는 내용까지 ListView 안에 넣었습니다.
전체적으로 말씀 드리면 레이아웃은 RelativeLayout 으로 구성한후 Content (ListView)부분을 BELOW,title (타이틀 아래) 로 속성을 주시고,
댓글 다는 부분은 ALIGN_PARENT_BOTTOM (부모 뷰의 아래부분과 맞춤, 즉 화면 맨 아래에 배치) 속성을 주는 식으로 구성하시면 될꺼에
여