[AC-3576] Add view on touch start on image
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-05-04T08:22:20.000+0000 |
Affected Version/s | Appcelerator Studio 4.5.0 |
Fix Version/s | n/a |
Components | Alloy |
Labels | android |
Reporter | ajay |
Assignee | Shak Hossain |
Created | 2016-05-02T11:36:37.000+0000 |
Updated | 2016-05-04T08:23:11.000+0000 |
Description
i want to add a view on window. whenever i touch on image. but i not able to get exact point of touch . image is not adding where i touch.
Please find attached file
Attachments
File | Date | Size |
---|---|---|
touchapp.zip | 2016-05-02T11:32:07.000+0000 | 10477213 |
i have fixed this issue. now it is working fine on all android device. i used this code var carsideImage = Ti.UI.createImageView({ top:'30', image:'/honada.jpg', width:'80%', height:'70%' }); $.index.add(carsideImage); var coer; carsideImage.addEventListener('touchstart',function(e){ if(isAdd) { coer = carsideImage.convertPointToView({x: e.x, y: e.y}, $.index); console.log(coer.x,coer.y); setlb(); } }); var i = 0; function setlb() { console.log(Ti.Platform.displayCaps.logicalDensityFactor); var tag = Ti.UI.createImageView({ top:(coer.y / Ti.Platform.displayCaps.logicalDensityFactor) , left:(coer.x / Ti.Platform.displayCaps.logicalDensityFactor) , width:'15', zIndex:'10', borderRadius:'2', height:'15', backgroundColor:'red' }); $.index.add(tag); }
Hello [~ajaylawarsaini@gmail.com], Thanks for the update.