마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

LinearLayout 중첩사용 질문입니다

0 추천

 

미리 보기로 할 경우 원하는 모양대로 정상적으로 출력됩니다...

그런데 실행하면 하단에 있는 layout_comment 부분의 레이아웃 내용이 통쨰로 화면에 나타나지 않습니다

값은 정상적으로 넘어오는 것을 확인했구요...

RecyclerLayout 을 2개 선언한건데 아래에 있는 것이 안나오는 상황입니다

 

황당하게도 웹에서 등록한 게시글은 모두 정상적으로 출력되는데

앱에서 등록한 게시글은 layout_comment 부분의 LinearLayout이 통째로 나오지 않네요

구조를 이래저래 바꿔도 안되네요 도움좀 부탁드립니다!ㅜㅜ

 

 

betterfly (190 포인트) 님이 2017년 4월 19일 질문
위에 레이아웃이 커서그런거아닐까요? 매치패어런트인지 확인해봐여
pjh0911@outlook.com 으로 보내주세요.

2개의 답변

0 추천
우의 레이아웃이 커서 그런것 같네요...

스크롤을 달아서 시험해보고 알려주세요.
pjh0911 (300 포인트) 님이 2017년 4월 19일 답변
답변감사드립니다!
어디에 스크롤을 달면될까요?
전체에는 우선 스크롤을 달았는데, 저 리스트 부분에 스크롤을 또 하나 달아야 된다는 말씀이신가요?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:orientation="vertical"
              android:weightSum="5"
    >

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_weight="4"
        >

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="16dp"
            android:layout_marginLeft="16dp"
            android:layout_marginRight="16dp"
            android:orientation="vertical">



            <TextView
                android:id="@+id/text_title"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="left"
                android:paddingBottom="8dp"
                android:textSize="15dp"
                android:textStyle="bold"
                />

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:layout_gravity="left"
                android:layout_weight="2"
                android:orientation="horizontal"

                >

                <TextView
                    android:id="@+id/text_reg_nm"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textSize="12dp"
                    android:textStyle="bold"
                    />

                <TextView
                    android:id="@+id/bar"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingLeft="16dp"
                    android:paddingRight="16dp"
                    android:text="|"
                    android:textColor="@color/common_plus_signin_btn_text_dark_disabled"
                    android:textSize="12dp"
                    android:textStyle="bold"
                    />

                <TextView
                    android:id="@+id/text_reg_date"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="@color/common_plus_signin_btn_text_dark_disabled"
                    android:textSize="12dp"
                    />

                <TextView
                    android:id="@+id/bar2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingLeft="16dp"
                    android:paddingRight="16dp"
                    android:text="|  조회 :"
                    android:textColor="@color/common_plus_signin_btn_text_dark_disabled"
                    android:textSize="12dp"
                    android:textStyle="bold"/>

                <TextView
                    android:id="@+id/text_view_cnt"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:textColor="@color/common_plus_signin_btn_text_dark_disabled"
                    android:textSize="12dp"
                    />


            </LinearLayout>


            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@drawable/notice_add_line"
                android:layout_marginBottom="16dp"
                android:layout_marginTop="16dp"
                >
            </LinearLayout>
<LinearLayout
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                >

                <WebView
                    android:id="@+id/webview_contents"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left"
                    android:layout_marginBottom="16dp"
                    android:descendantFocusability="blocksDescendants"
                    android:focusable="true"
                    android:focusableInTouchMode="true"
                    />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginBottom="8dp"
                android:background="@drawable/notice_brown_line"
                >
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical"

                >

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="첨부파일"
                    android:textStyle="bold"
                    android:textSize="13dp"
                    android:layout_marginBottom="8dp"
                    android:textColor="@color/cardview_dark_background"/>

                <android.support.v7.widget.RecyclerView
                    android:id="@+id/list_attach"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    />
            </LinearLayout>

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:background="@drawable/notice_brown_line"
                >
            </LinearLayout>


            <LinearLayout
                android:id="@+id/layout_comment"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="8dp"
                    android:layout_marginTop="8dp"
                    android:layout_weight="0"
                    android:background="@drawable/notice_comment_line">

                    <TextView
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="댓글"
                        android:textStyle="bold"
                        android:textSize="13dp"
                        android:textColor="@color/cardview_dark_background"/>

                    <TextView
                        android:id="@+id/text_comment_cnt"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_marginLeft="16dp"/>
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="1dp"
                    android:background="@drawable/notice_add_line"
                    >
                </LinearLayout>

                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:orientation="vertical"
                    android:scrollbars="vertical"
                    android:layout_marginBottom="16dp"
                    >

                    <android.support.v7.widget.RecyclerView
                        android:id="@+id/list_comment"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"/>
                </LinearLayout>

            </LinearLayout>

        </LinearLayout>
    </ScrollView>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="50dp"
        android:gravity="bottom"
        android:layout_marginLeft="16dp"
        android:layout_marginRight="16dp"
        android:layout_weight="1"
        android:orientation="horizontal">

        <EditText
            android:id="@+id/edit_comment_write"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="2.5"
            android:gravity="bottom"
            android:hint="댓글을 달아주세요."

            />

        <Button
            android:id="@+id/btn_comment_send"
            android:layout_width="50dp"
            android:layout_height="30dp"
            android:background="@drawable/notice_comment_button"
            android:text="댓글"
            android:textSize="13dp"
            android:textColor="@color/cardview_light_background"
            android:textStyle="bold"/>
    </LinearLayout>


</LinearLayout>
길고 조잡스럽지만 위 코드가 전체 코드입니다...ㅠㅠ아직도 해결책을 찾지를 못했네요ㅜㅜㅜ도움부탁드립니다
0 추천
보기가 불편한데요...

그 xml파일을 메일로 좀 보내줄수 있겠나요?

미안합니다.
pjh0911 (300 포인트) 님이 2017년 4월 20일 답변
메일주소 확인이 안되네요ㅜㅜ 주소 주시면 보내겠습니다!! 감사합니다!
...