java - why is my getY() returning 0? -


I'm trying to click an ImageView move on the same status of another ImageView, on which onClickListener () I Can return X but not Y.

The copy I would like to see is in a different layout in XML, relative is in layout and in linear within the other relative.

That's because it checks the condition of y on the basis of the layout rather than the edge of the screen?

  Extension of Public Class Level Two Activity (ImageView iv1, iv2, iv3; @ Override Protected Zero to Creatives (InstanceStat saved from bundle) {// Todo Auto-Generated Method Stub Super Connet (saved instenstate); setContentView (R.layout.main); Iv1 = (ImageView) findViewById (R.id.imageView1); Iv2 = (ImageView) findViewById (R.id.imageView2); Iv1.setOnClickListener (new See onClickListener () {@Override Public Zero (see V) {// TODO auto generated method pause iv1.setY (iv2.getY ()); iv1.setX (iv2.getX ());}} );}}  

XML layout is something like this: Android: RelationLayout Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: Orientation = "vertical"> Android: Android: Android: LEA_AIT = "35 DP" Android: src = "@Drawable / WTSA" Android: Layout_belo = "@ + ID / Layout1" / Android: Android: Left_With = "35 DP"> LinearLayout Android: Id = "@ + id / layout1" Android: layout_height = "wrap_content" Android: layout_width = "fill_parent" Android: Orientation = "Horizontal" android: gravity = "center" & gt; & Lt; ImageView Android: id = "@ + id / imageView3" Android: layout_width = "55dp" Android: layout_height = "55dp" Android: src = "@drawable / wtsblank" />

That's because it's position of condition based on y position Checks the layout instead of the edge of the screen?

Yes, you are right.

In pixels, the visual wing of this scene gives it the property of the translation as well as the current top asset and the property is the top spot of this approach relative to their parent.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -