[TIMOB-25684] iOS: Expose UIInterpolatingMotionEffect Horizontal and Vertical
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2018-05-16T00:00:45.000+0000 |
Affected Version/s | Release 7.0.1 |
Fix Version/s | Release 7.3.0 |
Components | iOS |
Labels | community, demo_app, feature, ios |
Reporter | Carlos Henrique Zinato |
Assignee | Hans Knöchel |
Created | 2018-01-18T15:12:39.000+0000 |
Updated | 2018-11-15T16:51:35.000+0000 |
Description
Adds iOS homescreen like parallax effect to views based on Marcel Pociot's module https://github.com/mpociot/TiMotionEffects
How to use it:
var win = Ti.UI.createWindow({
backgroundColor: '#fff'
});
var background = Ti.UI.createImageView({
image: 'http://web-features.net/pb-examples/rainbow-at-sea/bg.jpg',
horizontalMotionEffect: {
min: -50,
max: 50
},
verticalMotionEffect: {
min: -50,
max: 50
}
});
win.add(background);
win.open();
PR: https://github.com/appcelerator/titanium_mobile/pull/9748
I would like to expose a "clearMotionEffects()" method. We use the API exposed by this ticket but see some glitches when switching tabs. This is the natively, but requires some handling to remove the motion-effect on blur and re-add it on focus. Using this API will solve it.