CardView in Xamarin.Forms -


i'm looking way dynamically generate card-like controls these:

enter image description here

i have been doing search , have found this article shows how implement cardview on xamarin.android project. i'm using xamarin.forms can compile ios well.

i tried use listview viewcells , couple stacklayout tags, wasn't able close that, here code:

<listview x:name="listview">     <listview.itemtemplate>         <datatemplate>             <viewcell height="300">                 <stacklayout>                     <stacklayout orientation="horizontal">                         <image source="{binding useravatar}" />                         <label text="{binding username}" />                     </stacklayout>                     <image source="{binding bittimage}" />                 </stacklayout>             </viewcell>         </datatemplate>     </listview.itemtemplate> </listview> 

i'm pretty new xamarin, if i'm missing basic, please let me know guys.

you on right track. use listview, frame root element , margin, , set background color of listview appropriate. should give card look. fill in card require.

<listview x:name="listview" backgroundcolor="gray">     <listview.itemtemplate>         <datatemplate>             <viewcell height="300">                 <frame hasshadow="true" margin="5">                     <stacklayout>                         <stacklayout orientation="horizontal">                             <image source="{binding useravatar}" />                             <label text="{binding username}" />                         </stacklayout>                         <image source="{binding bittimage}" />                     </stacklayout>                 </frame>             </viewcell>         </datatemplate>     </listview.itemtemplate> </listview> 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -