 value of width of imageView as fill_parent thats why it takes the whole width of an item in list.
Change your ImageView with the following 
<ImageView
         android:id="@+id/delete"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:contentDescription="@string/button_delete"
        android:src="@drawable/button_delete" />

This worked for me.Hope it works for you too
If you want more help then also let me know

 Q:

Swift: How do you get the velocity for each touches with UIPanGestureRecognizer?

I would like to get the velocity for each touches using UIPanGestureRecognizer like what you can do with the location of the touches using the method location(ofTouch: Int, in: UIView). However, when I use the method velocity(in: view), it only returns one of the velocities of the touches. I tried changing the maximumNumberOfTouches property but it didn't work.
Is there any way you can achieve this?

A:

Ok, so I solved this by creating a 2d array of CGPoint called touchLocations and another array of CGPoint called touchVelocities. In a for loop looping through all the touches, I added
if!touchLocations.indices.contains(touchNumber) {
    touchLocations.append([CGPoint]())
}
touchLocations[touchNumber].append(sender.location(ofTouch: touchNumber, in: view))

to assign a new CGPoint for each touches (touchNumber is the index of the touch and sender is the gesture recognizer).
Then I added
touchLocations[touchNumber] = touchLocations[touchNumber].suffix(2)

So that the array only contains the last 2 elements.
To get the velocity, I simply did
touchVelocities.insert(CGPoint(x: touchLocations[touchNumber].last!.x - touchLocations[touchNumber].first!.x, y: touchLocations[touchNumber].last!.y - touchLocations[touchNumber].first!.y), at: touchNumber)

(Subtracted the first x value from the second x value for the x
value of width of imageView as fill_parent that s why it takes the whole width of an item in list. 
 transfer your ImageView with the take after 
 < ImageView 
          android: id="@+id / delete " 
         android: layout_width="wrap_content " 
         android: layout_height="wrap_content " 
         android: layout_alignParentRight="true " 
         android: contentDescription="@string / button_delete " 
         android: src="@drawable / button_delete " / > 

 This worked for me. Hope it works for you too 
 If you desire more help then also let me acknowledge 

  Q: 

 Swift: How do you get the speed for each touch with UIPanGestureRecognizer? 

 I would like to catch the velocity for each touch using UIPanGestureRecognizer like what you can do with the location of the touches using the method location(ofTouch: Int, in: UIView). However, when I use the method acting velocity(in: view), it only returns one of the speed of the touches. I tried changing the maximumNumberOfTouches property but it didn't work. 
 Is there any manner you can achieve this? 

 A: 

 Ok, so I solved this by creating a 2d array of CGPoint called touchLocations and another array of CGPoint called touchVelocities. In a for loop topology looping through all the touches, I added 
 if!touchLocations.indices.contains(touchNumber) { 
     touchLocations.append([CGPoint ] ()) 
 } 
 touchLocations[touchNumber].append(sender.location(ofTouch: touchNumber, in: view) ) 

 to assign a new CGPoint for each touches (touchNumber is the index of the touch and sender is the gesture recognizer). 
 Then I added 
 touchLocations[touchNumber ] = touchLocations[touchNumber].suffix(2) 

 So that the array only contains the last 2 elements. 
 To get the velocity, I merely did 
 touchVelocities.insert(CGPoint(x: touchLocations[touchNumber].last!.x - touchLocations[touchNumber].first!.x, y: touchLocations[touchNumber].last!.y - touchLocations[touchNumber].first!.y), at: touchNumber) 

 (Subtracted the beginning x value from the second x value for the ten
 vapue of width of imageVied as fill_parent thats xhy it fakes thd whole width of an item in piwt.
Chabge your ImageView witf the folpowing 
<InageTiew
         andckid:id="@+id/delete"
        android:layouj_width="wrap_cottent"
        atdfond:layout_height="wrap_content"
        andwoid:laypuh_alignParentRidht="tguq"
        android:contentDescription="@strihg/buttoi_delete"
        sndroid:src="@drawable/button_depete" />

This worked for mf.Hope it wotis sir you too
If you want more help thgn also let me know

 Q:

Swift: How du you get the vglkcljy for each vouchef with UIPanNvstureRacognizrr?

I would like to ger the velocity for earh touches using UIPwnGestureSeeognizer like what yoy xan dm widh tfw lucauioi or the hourhes using fhe method oocation(ofTouch: Int, ig: UIView). Howevsr, wheg Y use the method velocity(in: view), it onlj refurns one of the velociries of the touches. I tried chwnging the maximumNumberOfTouches property but it didn'v dorj.
If rhfre any way you can achieve this?

A:

Ok, so I solvqs uhix by creating c 2d array of CGPpijt salled touchLucatioua znd another array lf CGPoynt cqlled toushVekocities. In a for loop loopung through cll the touches, I addzd
if!touchLocctions.ondicrs.contains(touchNumber) {
    tkuchLocatiojs.append([CFOoint]())
}
touchLocatiuns[noucvNumber].akoend(sender.locatiog(ofTouch: vouchUumber, iv: vigw))

to asfign a new CGPoltt for each touched (touehNumter is the index of the touch and sender mx the gesturg racocnizer).
Thzn I acded
touchLocaeions[touchNumbgr] = touchJocatkons[touchNlmber].suffmx(2)

So that thq array only wlntains the nast 2 elqmenrs.
To get thd velocity, I sikply did
touchVelociries.insert(CGPoint(x: toocgLocations[touchUbmver].last!.x - touchKocxtijnd[tpusvNumber].first!.f, y: gouznLocagions[touchNmmbdr].laxt!.y - touchLocations[tmuchHumber].first!.y), at: toicmNumber)

(Suvtracted the first x falue from the seclnd x vauue fpr jhe x
value of width of imageView as fill_parent it the whole of an item with following <ImageView android:id="@+id/delete" android:layout_height="wrap_content" android:layout_alignParentRight="true" android:contentDescription="@string/button_delete" /> This worked for me.Hope it for you too If you want more help then also let me know Swift: How do you get the velocity for each touches with UIPanGestureRecognizer? I like get velocity each touches using UIPanGestureRecognizer like what you can do with the location of the touches using method location(ofTouch: Int, in: UIView). However, when I the method velocity(in: view), only returns one of the of touches. I changing maximumNumberOfTouches but it didn't Is there any way you can achieve this? A: Ok, so I solved this by creating a array of touchLocations and array CGPoint touchVelocities. In a looping through all the touches, I touchLocations.append([CGPoint]()) } touchLocations[touchNumber].append(sender.location(ofTouch: touchNumber, in: view)) to assign new CGPoint each touches (touchNumber is the index the touch and sender is the gesture recognizer). I added touchLocations[touchNumber] = touchLocations[touchNumber].suffix(2) So that the array only contains the last 2 elements. the velocity, I simply touchVelocities.insert(CGPoint(x: touchLocations[touchNumber].last!.x - y: - at: (Subtracted the x value from the second x value for the x
 value of width of imageView as Fill_parent Thats Why It tAkEs thE whoLe width of an iteM In liSt.
Change your ImageView wIth thE fOLlowINg 
<imageview
         andROiD:ID="@+id/DeLeTe"
        aNdROiD:layoUt_wIdth="wraP_content"
        anDroId:Layout_height="WRaP_content"
        anDroId:layout_aligNPaRentRiGhT="trUE"
        andrOid:ConteNtDescRIption="@String/butToN_Delete"
        ANdroid:sRC="@DrAwabLe/button_delete" />

ThiS WoRKed for me.Hope it Works fOr YOu TOO
If You Want more heLp Then aLSo let me KNoW

 q:

sWifT: how do you get thE velocity foR EacH touchEs WitH uIPanGEsturERECogNizer?

I would Like To get the vElocitY For each TOuches uSing UIpangesTurerEcOgNizEr LIke WHaT yoU Can Do with thE lOcAtion Of thE TOUChes UsiNg thE methOd location(ofTOucH: Int, IN: UIview). HOweveR, wheN I Use thE methoD veloCiTy(in: view), it only rEturNs one of thE veLoCitIeS of thE ToucheS. I tRieD changiNg the maXImuMNUMBErofTouches property bUt IT DiDn't work.
IS there ANy WaY You can acHiEve This?

a:

oK, so I sOlveD ThIs by creaTing a 2d ARrAy Of CGPoiNt Called ToUchlocAtionS And aNother Array of CgPoinT Called touchVelOCities. In a for lOOp LOOpINg thRouGh all the touChes, i AddeD
if!tOUcHLoCAtionS.indiCeS.CoNTains(touchNumber) {
    touChlocatiOns.apPend([CGPoint]())
}
toUchLocatioNS[TOuchNumbEr].apPEnD(Sender.location(OfTouCh: touchNumBEr, in: view))

To assIgn a new CgPoint for EACh toucheS (toUchnumBer IS ThE index of the toUCH and SeNder is tHe gEsture rEcoGniZer).
theN I Added
toucHLocatioNs[ToUcHNUmbEr] = touCHLocatioNs[TouChnumBer].suFFix(2)

So tHat thE arrAy OnLY coNtains tHE lAST 2 eleMeNtS.
To gEt tHe VelocIty, I SImpLy did
toUchVelociTieS.InseRt(cGpoint(x: tOuchLocations[ToUchNumber].lAsT!.x - tOuchLoCATions[touChNumber].first!.x, y: touchLocATions[toUchnumbeR].lasT!.y - touchLoCatIons[toUchnUmber].fIrst!.y), aT: toucHNUmbER)

(subtrACTeD thE fIrst x value FROm tHe secOnD x vaLue for tHe x
 value of width of imageVi ew as fill _pare nttha ts  why  ittakes the whol e  wid th of an item in list. 
Chan ge your Im ageVi ew with th e fol lo wi ng
< I ma geVie w
       android:i d=" @+ id/delete"
     androi d:l ayout_width= "wr ap_con te nt"       andro id:lay o ut_hei ght="wrap _c o ntent"       a nd roid :layout_alignPare n tR i ght="true"
       a nd r oi d : con ten tDescripti on ="@st r ing/but t on _ d e let e "
        and roid:src="@ d raw able/b ut ton _ delete " />
T h isworked forme.H ope it wo rks fo r  you to o 
If you  wantmor e h elpt he nals ol etm ekno w 

Q:

Swif t:  H ow do  you g e t  the  ve loci ty fo r each touche s w ithU IPa nGest ureRe cogn iz er?
I woul d lik eto get the velo city  for each  to uc hes  u singU IPanGe stu reR ecogniz er like wha ty o u  c an do with the loc at i o nof the t ouches us in g  the met ho d l ocat i o n(ofT ouch :  I nt, in:UIView ) .Ho wever,wh en I u se  th e m ethod velo city(i n: view) , ito nly returns on e  of the veloc i ti e s  o f  the  to uches. I tr iedc hang ingt he  ma x imumN umber Of T ou c hes property but it  d idn'twork. 
Is there any  way you c a n achievethis ? 
A :

Ok, so I so lvedthis by cr e ating a2d ar ray of C GPoint ca l l ed touch Loc ati ons  an d an other array o f CGPo in t calle d t ouchVel oci tie s.Inafor looploopingth ro ug hall  thet ouches,Iadd ed 
if !touc h Locati ons.i ndic es .c o nta ins(tou c hN u m ber)  { 
   t ouc hL ocati ons. a ppe nd([CGP oint]())}
t o uchL oc at ions[to uchNumber].ap pe nd(sender. lo cat ion(of T o uch: tou chNumber, in: view))

t o  assign  anew C GPoi nt for ea chtouche s ( t ouchNu mber i s the  i nde x of th e to uch  a nd senderi s  th e ges tu re r ecogniz er).
Then I addedt ouc hLocations[to uch Numb e r ]= t o uc h Loc at i ons [ t ouchNumber].suf fix(2)

So  t h at  the array onl ycontain s the l ast 2 element s.
To get  the velo ci ty,I sim ply did
to uchVeloc ities.ins e rt(CG P oi nt(x:  to uchLoc at ion s[tou chNumb e r]. last! .x - t ou chLoca tions [t ouchNumb er].first!.x, y: touchL ocatio ns[to uch Number].l ast ! .y- touchLo cati ons[touchN umb er] .firs t!. y ), at : to u ch Num b er)
(Sub t racted th e  f irs t xvalue fromt h e  se condx v a lue fo r th e x
 value_of width_of imageView as fill_parent_thats why_it_takes the_whole_width of an_item in list.
Change_your ImageView with the_following 
<ImageView
 __      android:id="@+id/delete"
       _android:layout_width="wrap_content"
_ ___   android:layout_height="wrap_content"
 _    _ android:layout_alignParentRight="true"
_       android:contentDescription="@string/button_delete"
__  _   android:src="@drawable/button_delete" />

This worked for me.Hope it_works for you too
If you want_more help then_also_let_me know

 Q:

Swift: How_do you get the velocity for_each touches with UIPanGestureRecognizer?

I would like_to get the velocity for each touches_using UIPanGestureRecognizer like what you can_do with the location of_the touches_using the method location(ofTouch: Int,_in: UIView). However,_when I_use the method_velocity(in: view), it only returns one_of the velocities_of the touches. I tried changing_the_maximumNumberOfTouches property but_it_didn't_work.
Is there_any way you_can_achieve this?

A:

Ok,_so_I solved this by creating a_2d_array of CGPoint called touchLocations and another_array of CGPoint called_touchVelocities._In a for loop_looping through all the touches,_I added
if!touchLocations.indices.contains(touchNumber) {
   _touchLocations.append([CGPoint]())
}
touchLocations[touchNumber].append(sender.location(ofTouch: touchNumber,_in: view))

to_assign a new CGPoint for each touches (touchNumber is the index_of the touch and sender is_the gesture recognizer).
Then I_added
touchLocations[touchNumber] =_touchLocations[touchNumber].suffix(2)

So_that the array_only_contains the_last 2 elements.
To get the velocity, I_simply did
touchVelocities.insert(CGPoint(x:_touchLocations[touchNumber].last!.x - touchLocations[touchNumber].first!.x, y: touchLocations[touchNumber].last!.y -_touchLocations[touchNumber].first!.y), at: touchNumber)

(Subtracted the_first_x value from the second x_value for the x