How to place textviews center with near imageview and textview android? -
hi want achieve desired output similar screenshot attached below. view line separation need place textview @ center , near textview image , text size , color. how achieve it?
my code follows:
i used view line @ top , bottom , used textview doesn't achieve exact output. how solve issue? please me. thanks..
<view android:id="@+id/view2" android:layout_width="wrap_content" android:layout_height="1dp" android:layout_below="@+id/offers_price_layout" android:layout_centervertical="true" android:layout_margintop="5dp" android:background="#cfcfcf" /> <relativelayout android:id="@+id/size_color_layout" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_below="@+id/view2" android:orientation="horizontal" > <linearlayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:weightsum="4" android:orientation="horizontal"> <textview android:layout_width="0dp" android:layout_weight="1.4" android:layout_height="fill_parent" android:text="size" android:paddingright="10dp" android:gravity="center" /> <textview android:layout_width="0dp" android:layout_weight="0.3" android:layout_height="fill_parent" android:text="7" android:paddingtop="10dp" android:paddingbottom="10dp" android:layout_margintop="2dp" /> <view android:layout_width="1dp" android:layout_height="fill_parent" android:background="#cfcfcf" /> <textview android:layout_width="0dp" android:layout_weight="1.7" android:layout_height="fill_parent" android:text="color" android:gravity="center" /> <imageview android:layout_width="0dp" android:layout_weight="0.6" android:layout_height="fill_parent" android:paddingtop="10dp" android:paddingbottom="10dp" android:src="@drawable/product_wish" /> </linearlayout> </relativelayout> <view android:id="@+id/view3" android:layout_width="wrap_content" android:layout_height="1dp" android:layout_below="@+id/size_color_layout" android:layout_centervertical="true" android:background="#cfcfcf" />
below screenshot want achieve.
follow these steps:
- create parent horizontal linear layout
- put 2 relative layouts equal weight
- insert horizontal linear layout in both center in parent
- put textview , imagevew both wrapping content