[TIMOB-25557] Android: View rect x and y are inconsistent
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2018-02-22T00:25:35.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Release 7.1.0 |
| Components | Android |
| Labels | rect, view |
| Reporter | Guile |
| Assignee | Gary Mathews |
| Created | 2017-11-23T11:04:47.000+0000 |
| Updated | 2018-02-22T00:26:23.000+0000 |
I know that, and I have to manage the contentOffset in a Scrollview. But this is inconsistent with documentation and is a BC break. Maybe rect could also contain "absolute" x and y (which can be very useful too) ?
PR: https://github.com/appcelerator/titanium_mobile/pull/9626 Classic version of the test above:
var win = Ti.UI.createWindow({ backgroundColor: 'gray' }); var vw = Ti.UI.createView({ top: 100, left: 100, width: 200, height: 200, backgroundColor: "blue" }); var inner = Ti.UI.createView({ top: 20, left: 20, width: 30, height: 30, backgroundColor: "yellow" }); vw.add(inner); win.add(vw); win.addEventListener('click', function(e) { if (OS_IOS) { Ti.API.info('Rect : ' + JSON.stringify({ x: e.source.rect.x, y: e.source.rect.y, width: e.source.rect.width, height: e.source.rect.height })); } else { Ti.API.info('Rect : ' + JSON.stringify(e.source.rect)); } }); win.open();master: https://github.com/appcelerator/titanium_mobile/pull/9816
Fix was found in SDK 7.1.0.v20180221140035