Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3576] Add view on touch start on image

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2016-05-04T08:22:20.000+0000
Affected Version/sAppcelerator Studio 4.5.0
Fix Version/sn/a
ComponentsAlloy
Labelsandroid
Reporterajay
AssigneeShak Hossain
Created2016-05-02T11:36:37.000+0000
Updated2016-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

FileDateSize
touchapp.zip2016-05-02T11:32:07.000+000010477213

Comments

  1. ajay 2016-05-04

    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); }
  2. Nazmus Salahin 2016-05-04

    Hello [~ajaylawarsaini@gmail.com], Thanks for the update.

JSON Source