【问题标题】:Custom tableview in appcelerator titaniumappcelerator 钛合金中的自定义表格视图
【发布时间】:2012-12-12 14:29:13
【问题描述】:

我正在 Titanium 中开发 tableView 应用程序。我需要在两个部分中显示数据。 在第 1 节我想显示单元格分隔符,而在 第 2 节我不想要任何单元格分隔符。

我可以使用 tableview 的分隔符样式属性来删除分隔符样式,例如:

separatorStyle: Titanium.UI.iPhone.TableViewSeparatorStyle.NONE,

但我的问题是它会从整个 tableView 中删除单元格分隔符。但我不希望这样,我需要第 1 节中的分隔符。

tableView 类似于:

这可能实现吗?或者我需要使用单个 Row 自定义第二部分并为其添加单独的标签?

【问题讨论】:

标签: ios titanium tableview appcelerator titanium-mobile


【解决方案1】:

在 Titanium Appcelerator 的 TableViewRow 文档 (http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.UI.TableViewRow-property-selectionStyle) 中,您没有属性 separatorStyle,因为它是 TableView 的一个属性。

尝试手动制作行分隔符(在第一部分):

    tableViewRow.add( Ti.UI.createView({
            height: 1,
            width: Ti.UI.FILL,
            backgroundColor: "#000000",
            bottom: 0
    }) );

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-08-04
    • 2012-07-18
    • 1970-01-01
    相关资源
    最近更新 更多