[ALOY-1320] Styles not applied when an element uses another namespace
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-10-30T09:39:35.000+0000 |
Affected Version/s | alloy 1.7.22 |
Fix Version/s | Release 5.2.0, alloy 1.7.23 |
Components | Styling |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Feon Sua Xin Miao |
Created | 2015-10-28T12:43:27.000+0000 |
Updated | 2016-02-02T23:03:31.000+0000 |
Description
When an Alloy view element uses another namespace styles are no longer applied. When you setns
to the default Ti.UI
it still works, but any other value will not.
*index.xml*
<Alloy>
<Window>
<View />
<View ns="Ti.UI" />
<View ns="Ti.UI.Android" />
</Window>
</Alloy>
*index.tss*
'View': {
backgroundColor: 'red'
}
*Compiled code*
$.__views.__alloyId0 = Ti.UI.createView({
backgroundColor: "red",
id: "__alloyId0"
});
$.__views.index.add($.__views.__alloyId0);
$.__views.__alloyId1 = Ti.UI.createView({
backgroundColor: "red",
id: "__alloyId1"
});
$.__views.index.add($.__views.__alloyId1);
$.__views.__alloyId2 = Ti.UI.Android.createView({
id: "__alloyId2"
});
Comments
- Feon Sua Xin Miao 2015-10-28
Is
Ti.UI.Android.createView()
a valid function? Regardless, the workaround for now is to assign anid
to the view that uses another namespace. - Fokke Zandbergen 2015-10-29 No it's not ;) But you get the idea right?
- Feon Sua Xin Miao 2015-10-29
PR: https://github.com/appcelerator/alloy/pull/736
Test app: https://github.com/feons/alloy/tree/ALOY-1320/test/apps/testing/ALOY-1320
Functional Test:
1. Run test app, style should be applied to
CustomLabel
and it's text should be red. - Fokke Zandbergen 2015-10-30 Tested using the included app and compiled code is as expected!
- Eric Wieber 2016-02-02 Verified fixed, using: MacOS 10.11.3 (15D21) Studio 4.5.0.201601262138 Ti SDK 5.2.0.v20160202103508 Appc NPM 4.2.3-1 Appc CLI 5.2.0-239 Alloy 1.7.33 Xcode 7.2 (7C68) Styles are correctly applied when the element is using a namespace other than the default. Tested using the provided test case and the app located here: https://github.com/feons/alloy/tree/ALOY-1320/test/apps/testing/ALOY-1320