<?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="50dp">
 
 <TextView
  android:text="start date"
  android:id="@+id/StartDateTextView"
  android:layout_alignParentLeft="true"
  android:layout_marginLeft="10dp"
  android:layout_width="70dp"
  android:layout_height="fill_parent" android:gravity="right|center_vertical">
 </TextView>
 
 <ImageView
  android:id="@+id/IcomImageView"
  android:background="@color/BLUE_COLOR"
  android:layout_toRightOf="@+id/StartDateTextView"
  android:layout_centerVertical="true"
  android:layout_marginLeft="10dp"
  android:layout_width="20dp"
  android:layout_height="20dp">
 </ImageView>
 <TextView
  android:text="schedule"
  android:id="@+id/DataTextView"
  android:layout_toRightOf="@+id/IcomImageView"
  android:layout_marginLeft="10dp"
  android:layout_width="190dp"
  android:layout_height="fill_parent" android:gravity="center_vertical">
 </TextView>
</RelativeLayout>

xml 코드 상으로는 위와 같습니다.

빨간색 처리한 부분을 보시면
gravity 값으로 right 과 center_vertical 을 주었는데
xml 코드를 저렇게 입력하고 레이아웃으로 보면 제대로 적용되지만
에뮬레이터로 보면 right 은 적용이 되지만 center_vertical 은 적용이 되지 않습니다.
그러나 파란색 처리한 부분은 문제없이 적용이 되네요.

주 컴포넌트는 layout_height 도 똑같고 딱히 지장을 줄만한 설정값이 없는것 같은데 이유를 모르겠습니다.
혹시 비슷한 증상이 있으셨던 분들 계신가요?
답변 주시면 감사하겠습니다~



참고로 소스를 코드 하이라이터로 올리고 싶었지만 색처리때문에 그냥 올렸습니다~
읽기 불편하게 해드려 죄송합니다~

profile