這是用於創建列表視圖並使用appcelerator中的模板添加元素的.xml文件。如何設置.tss文件中列表項中的內容的樣式。例如。我希望圖像位於最左邊,標題位於下面的中間,這將是日期和網址。使用應用程序中的模板向listview添加元素
<Alloy>
<Window id="win2" class="container">
<View id = "v1" class ="view1" layout ="horizontal" >
<Button class="btnBack" ></Button>
<Label class = "label1">List</Label>
</View>
<View class="view2">
<TextField id = "txtSearch"></TextField>
</View>
<ListView id = "lView" class = "list1" >
<Templates>
<ItemTemplate name="template">
<ImageView bindId="pic" id="iconId" />
<Label bindId="info" id="titleId" />
<Label bindId="date" id="dateId" />
<Label bindId="url" id ="urlId" />
</ItemTemplate>
</Templates>
<ListSection>
<ListItem pic:image="/Images/abstract-logo-with-colorful-leaves_1025-695.jpg" info:text ="This is the title" date:text= "6/30/2017" url:tex ="https://youtu.be/zkOSR0ZRb9k"></ListItem>
</ListSection>
</ListView>
</Window>
</Alloy>
我的男人雷甚至爲你設定了造型! –