【问题标题】:Difference between Ti.UI.Fill and 100% in Titanium Alloy/ Appcelerator钛合金/Appcelerator 中 Ti.UI.Fill 和 100% 的区别
【发布时间】:2017-08-04 19:23:09
【问题描述】:

以下内容填满整个屏幕:

<View height="Ti.UI.FILL" width="Ti.UI.FILL">...</View>

此处描述了填充属性:http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI-property-FILL

但是你也可以使用:

<View height="100%" width="100%">...</View>

所以我的问题是,有什么区别?

【问题讨论】:

    标签: titanium appcelerator appcelerator-titanium titanium-alloy appcelerator-alloy


    【解决方案1】:

    官方指南说: “Ti.UI.FILL 行为表示增长视图以填充其父级的尺寸。请注意,FILL 行为不考虑父级中的其他同级元素。” http://docs.appcelerator.com/platform/latest/#!/guide/Layouts,_Positioning,_and_the_View_Hierarchy

    肯定 Ti.UI.FILL 是一个 Titanium 常量,您可以按原样在任何地方使用,而 100% 是一个字符串。我总是喜欢第一个。 当我们将两个元素放在同一个容器中时,可能会有所不同它应该填充一个空间,它是容器中唯一的一个,所以我从来没有注意到任何区别。

    【讨论】:

    • 你能提供一个具体的例子吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-12-30
    • 1970-01-01
    • 2012-07-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多