XML は次のとおりです。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@android:color/transparent" >
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_toLeftOf="@+id/weightLossIndicator"
android:paddingLeft="15dp"
android:paddingRight="10dp"
android:orientation="vertical">
<TextView
android:id="@+id/weightValueTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingTop="10dp"
android:textColor="@android:color/black"
android:textSize="30sp"
android:textStyle="normal" />
<TextView
android:id="@+id/weightDateTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@android:color/black"
android:textSize="20sp" />
<TextView
android:id="@+id/weightDifferenceTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingBottom="10dp"
android:textColor="@android:color/black"
android:textSize="20sp" />
</LinearLayout>
<ImageView
android:id="@+id/weightLossIndicator"
android:layout_width="10dp"
android:layout_height="match_parent"
android:layout_alignParentRight="true"
android:background="@color/change_green"/>
<View
android:id="@+id/separator"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_alignParentBottom="true"
android:layout_below="@+id/weightLossIndicator"
android:layout_marginLeft="15dp"
android:background="@color/dark_blue" />
</RelativeLayout>
ビューweightLossIndicator
は、レイアウト上の他の要素 (それらの位置) に影響しますが、デバイスとシミュレーターには表示されません。背景色は不透明で、グラフィカル レイアウトに表示されます。
更新:
ImageView の固定の高さを 40 dp に設定しようとしましたが、それが表示されます。何か間違った使い方match_parent
をしていますが、何がわかりません。ListView
また、この XML を行レイアウトとして使用していると言わざるを得ません。