Description
If we set orientationModes on window in app.tss file portrait, landscape both and any individual tss file only portrait then portrait mode does not work for individual tss.
Steps to reproduce
1. Just create an alloy project.
2. Replace this app.tss and index.tss file,
3. Run this code in device or emulator.
4. Rotate device.
5. It does not stop.
actual behaviour
If device rotate, the app orientation change.
Expected behaviour
Since orientation Modes "PORTRAIT" for the index.tss file so it should be always portrait.
"Window": {
orientationModes: [Ti.UI.PORTRAIT,Ti.UI.LANDSCAPE_LEFT,Ti.UI.LANDSCAPE_RIGHT],
backgroundColor: "red"
}
"Window": {
orientationModes: [Titanium.UI.PORTRAIT],
backgroundColor: "blue"
}
Feon hasn't look into this yet but, 1. There's a workaround here right? that is to NOT set the global style, and just use individual styles for all views. 2. I don't think it's good mobile practice to have different forms of orientation in a single app. it should be consistent throughout. So this issue might be invalid, as i don't think orientationModes is supposed to be used this way. [~fmiao] right?
PR: https://github.com/appcelerator/alloy/pull/781
PR approved and merged.
Verified as fixed. Local styles now override global styles. Tested on:
*Closing ticket*