안녕하세요.
또 레이아웃에서 삽질중입니다.
렐러티브 레이아웃에서 삽질중인데요.
렐러티브 레이아웃이 있고 그 안에
이미지뷰
텍스트뷰
이렇게 순차로 배치를 하였습니다. 수직으로..
그리고 텍스트뷰에 layout_below 값을 주고 태상은 이미지뷰로 하여 이미지 뷰 아래쪽에 놓이게금 세팅을 했습니다.
그리고 이미지뷰의 가로를 꽉차게 세로를 꽉차게 하였고
텍스트뷰는 가로 꽉차게, 세로 워랩 랩으로 하였습니다.
의도는 이미지뷰는 가로세로 모두 match_parent 로 속성을 주어 꽉차게 하고싶었습니다.
그리고 텍스트뷰는 세로를 워랩 랩한 자기 최소한의 공간은 보장받게 하고 싶었습니다.
리니어레이아웃이라면 weight 값으로 0과 1로 주면 되었을텐데
렐러티브 레이아웃에서는 방법이 없나요?
제가 위에 설정한대로 속성을 주니 텍스트뷰가 사라졋네요;;
현재 코드입니다.
<?xml version="1.0" encoding="utf-8"?>
android:layout_width="match_parent"
android:layout_height="match_parent" >
<ImageView
android:id="@+id/imageView1"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:src="@drawable/ic_launcher" />
<TextView
android:id="@+id/textView1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/imageView1"
android:text="TextView" />
</RelativeLayout>
결론은 저 TextView가 위에 이미지가 match로 꽉 채우더라도 TextView는 화면밖으로 튕겨나가지 않고
자기 자신의 위치는 굳건히 지키게 하고 싶습니다.
조언 부탁드립니다.^^