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

RelativeLayout 레이아웃 xml 에서 실행해보면

0 추천
아래 레이아웃 xml 에서 실행해보면

@+id/list 의 TextView 의 텍스트가 나오지않습니다

잘못된부분좀 살펴봐주시면 감사하겠습니다

 

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/listbaselayout"
    android:layout_width="match_parent"
    android:layout_height="match_parent">
    
    <LinearLayout
            android:id="@+id/headLay"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentTop="true">
            <LinearLayout
                android:id="@+id/headUpLay"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true" />
          
    </LinearLayout>
    
    <LinearLayout
            android:id="@+id/okLay"
            android:orientation="vertical"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_alignParentBottom="true">
            <LinearLayout
                android:id="@+id/topLay"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true" />
            <LinearLayout
                android:id="@+id/upLay"
                android:orientation="horizontal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true" />
    </LinearLayout>
    
    <!-- Content -->
    <ScrollView android:layout_width="match_parent"
        android:layout_height="0dip" android:layout_weight="1">
        <LinearLayout android:id="@+id/list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:layout_above="@id/okLay"
            android:layout_below="@id/headLay" >
            <TextView android:text="TextView"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:textColor="#fffeeeef"
                android:id="@+id/testtext" />
        </LinearLayout>
    </ScrollView>
    
</RelativeLayout>
구름처럼달처럼 (5,830 포인트) 님이 2015년 4월 7일 질문

1개의 답변

+1 추천
 
채택된 답변
layout_height="0dip" 로 되어 있으니 안나올수 밖에요

wrap_content 또는 match_parent로 바꿔서 해보세여

layout_weight 속성은 RelativeLayout에서 사용가능한 파라미터가 아닙니다.
Gradler (109,780 포인트) 님이 2015년 4월 7일 답변
구름처럼달처럼님이 2015년 4월 7일 채택됨
답변감사합니다
하나만더...
가르쳐주신대로 고쳤는데 이번에는
@+id/headLay 에 addView 된 텍스트뷰 와
@+id/list 에 들어있는 텍스트뷰가 겹쳐집니다
왜 이럴까요?
@+id/headLay 의 아래쪽에 @+id/list 가 위치해야되는데
이상합니다
...