Problem Description
It is not possible to hide a view within TextArea. Properties/Methods
visible
,
hide
,
show
are basically ignored. Works fine in Classic Ti and it worked in Alloy too... (I can't say exactly in what version ,but it worked for sure...).
Testcase
index.js
function hideRedView(e) {
$.redView.visible = !$.redView.visible;
console.log("RED VIEW SHOULD BE: " + ($.redView.visible ? "shown" : "hidden"));
};
$.index.open();
index.xml
<Alloy>
<Window>
<TextArea id="textArea">
<View id="redView"/>
</TextArea>
<Button title="Click!" onClick="hideRedView"/>
</Window>
</Alloy>
index.tss
"Window": {
backgroundColor: "white",
layout: "vertical"
}
"#textArea": {
width: "80%", height: 300,
borderWidth: "1px",
borderColor: "gray",
top: 30
}
"#redView": {
width: 100, height: 100,
backgroundColor: "red"
}
Extra information
The Support Team tested this in Ti Classic, is working just fine. The testcase is in a comment.
Hi, We tried to reproduce this issue with the given sample test code. It’s a valid bug. It doesn’t work in Alloy but works fine in Ti Classic.
TESTING ENVIRONMENT:
Ti SDK 3.4.0.GA Ti CLI 3.4.0 Alloy 1.5.1 Mac OS X 10.9.5 iOS v8.0TEST CODE:
STEPS TO TEST:
- Create a simple project. - Update project with test code - Run on iOS device/ simulatorEXPECTED RESULT:
It’s not working as expected. Thanks[~skypanther]: The original reporter is [~sko]. Thanks!
Adding child views to TextArea is supported on only iOS. Even there, our docs recommend to instead use a wrapper view around the TextArea with the "child" view inside that wrapper, overlaying the TextArea. Doing so would be a suitable workaround until we can resolve this issue.