I am making the list view in which I have a image view and to its left I have to align the TextView which should have text in the center of it not the bottom of it. I have set the gravity but its only looking good in the design but when I run my app and data is fetched in list view then the text gets set in the bottom .
I will show you what I mean by this.But first let me show you how I am doing to align this
<RelativeLayout
android:id="@+id/block_address"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_address"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/pin" />
<TextView
android:id="@+id/row_address"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_alignBaseline="@+id/iv_address"
android:layout_alignBottom="@+id/iv_address"
android:layout_marginLeft="3dp"
android:layout_toRightOf="@+id/iv_address"
android:gravity="center|center_vertical"
android:text="Address Goes here"
android:textColor="#AAAAAA" />
</RelativeLayout>
and this is how I am getting this
And this is what I want it to be
as you can see in the second picture I want this type of adjustment. and in design preview it is showing me design just like it is expected. But When I run the app it just showing me text like i showed you in picture one.
Please tell me what i am doing wrong and How to constrict this not to get out of allignment.
TextView
on its own.