代码之家  ›  专栏  ›  技术社区  ›  Stephen Alejandro Alcalde

ListViewLinearLayout项宽度在本机脚本的Android平台中不支持

  •  0
  • Stephen Alejandro Alcalde  · 技术社区  · 7 年前

    文档:

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

    为了在RecyclerView中执行水平滚动,我根据文档使用了ListViewLinearLayout。

    他们明确提到的文件本身: The itemHeight and itemWidth properties are iOS specific. If not used, items are sized dynamically depending on the data coming from the source.

    代码:

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

    itemWidth属性仅适用于iOS。不在Android中。width项宽度的帮助我们可以设置项之间的宽度。

    我尝试设置width=“70”或width=“70%”或android:itemwidth=“70”没有任何效果。有任何解决此问题的建议。

    1 回复  |  直到 7 年前
        1
  •  1
  •   Manoj    7 年前

    如文件所述, itemWidth 仅iOS支持。如果要在项目之间设置间距,请使用 margin 在项目模板上。

    推荐文章