【问题标题】:Titanium Layout not working while set touchEnabled=false inside Listview在 Listview 中设置 touchEnabled=false 时,Titanium 布局不起作用
【发布时间】:2014-12-03 09:50:45
【问题描述】:

当我为列表视图模板中的视图设置 touchEnabled="false" 时,我的所有列表视图布局都被破坏了。当我删除启用触摸的属性时,它工作正常。任何人都请帮我解决这个问题。 钛 SDK : 3.4.0 , 操作系统:IOS和安卓, 这是我的示例代码。

<Alloy>
    <Window backgroundColor="#fff">
        <ListView id="LstView" top="50" defaultItemTemplate="template1">
            <Templates >
                <ItemTemplate id="mytemplate" name="template1">
                    <View layout="horizontal" width="Ti.UI.FILL" touchEnabled="false">
                        <View width="Ti.UI.SIZE" height="Ti.UI.SIZE" left="5">
                            <Label bindId="Lbl1" Id="Lbl1" color="black"></Label>
                        </View>
                        <View width="Ti.UI.SIZE" height="Ti.UI.SIZE" left="10" >
                            <Label bindId="Lbl2" Id="Lbl2" color="black"></Label>
                        </View>
                        <View width="Ti.UI.SIZE" height="Ti.UI.SIZE" left="10">
                            <Label bindId="Lbl3" Id="Lbl3" color="black" ></Label>
                        </View>
                    </View>
                </ItemTemplate>
            </Templates>
            <ListSection>
                <ListItem Lbl1:text="hello" Lbl2:text="how are you?" Lbl3:text="I am fine" height='70'/>
            </ListSection>
        </ListView>
    </Window>
</Alloy>

【问题讨论】:

    标签: titanium titanium-mobile titanium-alloy


    【解决方案1】:

    根据this articletouchEnabled = false 将把触摸事件转发给它的同伴。你能显示你的整个xml文件吗?我还不能澄清任何事情..

    【讨论】:

    • 在那里添加了我的完整 XML 代码。只需在有和没有 touchEnable 属性的情况下运行它。当 touchenabled 设置为 true 时,您可以看到水平对齐问题。
    • 我看不出有什么不同。什么平台给你这个问题?我在 iOS 上测试过。
    • 您使用的是哪个 SDK?我正在使用 3.4.0 并在 IOS 中进行了测试。
    • 我使用的是 Titanium 3.3.0
    【解决方案2】:

    这似乎是一个钛虫..在 JIRA 中打开一张票..Jira Bug Report

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-07-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多