nativescriptnativescript-angularradlistview

ListviewLinearLayout itemWidth not supporting in android platform of nativescript


Documentation:

https://docs.telerik.com/devtools/nativescript-ui/Controls/NativeScript/ListView/item-layouts#using-listviewlinearlayout

To perform horizontal scroll in recyclerview i have used ListViewLinearLayout as per the documentation.

Documentation itself they mentioned clearly: The itemHeight and itemWidth properties are iOS specific. If not used, items are sized dynamically depending on the data coming from the source.

Code:

 <ListViewLinearLayout scrollDirection="Horizontal" tkListViewLayout itemWidth="70">
 </ListViewLinearLayout> 

itemWidth property only working for ios. not in android. Width the help of itemWidth we can set width between items.

i tried setting width="70" or width="70%" or android:itemWidth="70" nothing worked at all.Any suggestions to overcome this issue.


Solution

  • As mentioned in the documentation, itemWidth is only supported on iOS. If you like to setup space between items, use margin on the item template.