Venkata Swamy Balaraju

Venkata Swamy Balaraju

  • NA
  • 3.9k
  • 921.3k

How to create Horizontal MvxListView in Xamarin.Android MVVM

Mar 28 2018 6:22 AM
Hi EveryOne,
 
I have list of items those I need to display Horizontally with scroll.
 
I'm using Mvvm-Crosss, I created MvvmListView and added MvxItemTemplate for that MvvmListView Like below. 
 
MvxListView:
  1. <MvxListView  
  2.             android:id="@+id/RelatedProductItems"  
  3.             app:MvxItemTemplate="@layout/related_product_item"  
  4.             android:layout_width="match_parent"  
  5.             android:layout_height="100dp"  
  6.             android:layout_margin="10dp"  
  7.             android:nestedScrollingEnabled="true"  
  8.    app:layout_constraintTop_toBottomOf="@id/CompleteExperienceLayout" />  
related_product_item
  1. <?xml version="1.0" encoding="utf-8"?>    
  2. <android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"    
  3.     xmlns:app="http://schemas.android.com/apk/res-auto"    
  4.     android:layout_width="match_parent"    
  5.     android:layout_height="wrap_content">    
  6.     <ImageView    
  7.         android:id="@+id/ProductImage"    
  8.         android:layout_width="60dp"    
  9.         android:layout_height="60dp"    
  10.         android:scaleType="fitXY"    
  11.         app:MvxBind="Bitmap StringToImage(ImageData)"    
  12.         android:layout_marginTop="5dp"    
  13.         android:layout_marginLeft="5dp"    
  14.         android:paddingBottom="5dp"    
  15.         app:layout_constraintLeft_toLeftOf="parent"    
  16.         app:layout_constraintTop_toTopOf="parent" />    
  17.     <TextView    
  18.         android:id="@+id/ItemName"    
  19.         android:layout_width="0dp"    
  20.         android:layout_height="wrap_content"    
  21.         android:ellipsize="end"    
  22.         android:textColor="@color/black"    
  23.         android:textStyle="bold"    
  24.         android:maxLines="2"    
  25.         android:text="Product name"    
  26.         android:layout_marginLeft="5dp"    
  27.         app:MvxBind="Text Name"    
  28.         android:textSize="18sp"    
  29.         app:layout_constraintTop_toTopOf="@id/ProductImage"    
  30.         app:layout_constraintLeft_toRightOf="@id/ProductImage"    
  31.         app:layout_constraintRight_toRightOf="parent" />  
  32. </android.support.constraint.ConstraintLayout>  
How can I achieve? 
 
Thanks in advance.

Answers (1)