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.

enter image description here

follow these steps:

  1. create parent horizontal linear layout
  2. put 2 relative layouts equal weight
  3. insert horizontal linear layout in both center in parent
  4. put textview , imagevew both wrapping content

Popular posts from this blog

c# - ODP.NET Oracle.ManagedDataAccess causes ORA-12537 network session end of file -

matlab - Compression and Decompression of ECG Signal using HUFFMAN ALGORITHM -

utf 8 - split utf-8 string into bytes in python -