【问题标题】:Appcelerator Titanium Alloy: How to set the TableViewStyle to GROUPED in xmlAppcelerator 钛合金:如何在 xml 中将 TableViewStyle 设置为 GROUPED
【发布时间】:2012-12-30 20:53:15
【问题描述】:

我已经尝试了各种方法(也尝试将样式设置为 GROUPED):

<Alloy>
    <Window title="Add Remember">
        <TableView id="table" style="Ti.UI.iPhone.TableViewStyle.GROUPED">
        <!-->
            <TableViewSection headerTitle="Title">
                <TableViewRow><TextField hintText="Title" id="title"></TextField></TableViewRow>
            </TableViewSection>

            <TableViewSection headerTitle="Location">
                <TableViewRow><TextField hintText="Location" id="location"></TextField></TableViewRow>
            </TableViewSection>

            <TableViewSection headerTitle="Notes">
                <TableViewRow><TextArea hintText="Notes"></TextArea></TableViewRow>
            </TableViewSection>
        </!-->
        </TableView>
    </Window>
</Alloy>

但没有shebang。

我还注意到,在控制器文件中以编程方式设置它是有效的,但前提是我还没有向 TableView 添加任何部分或行(这就是上面注释掉部分和行的原因)。

如何在 xml 中设置此属性。

【问题讨论】:

    标签: titanium tableview appcelerator appcelerator-mobile


    【解决方案1】:

    我是这样做的:

    form.xml:

    <TableView class="form">
      ...
    </TableView>
    

    app.tss:

    ".form": {
      style: Ti.UI.iPhone.TableViewStyle.GROUPED
    }
    

    【讨论】:

      【解决方案2】:

      好的,解决方法是在TableView的xml中设置style="1";这也适用于未注释的部分和行。我通过将Ti.UI.iPhone.TableViewStyle.GROUPED 记录到控制台来解决这个问题;显然宏在 xml 中不起作用。

      【讨论】:

      • 我怀疑这是一个命名空间问题。当必要时可以创建 JIRA 时,我还建议将这些问题直接记录到合金用户组
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-12-30
      • 1970-01-01
      • 2012-07-18
      • 2020-10-29
      • 2017-08-04
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多