0

I have a layout that always rotate to the north. I want to put a pointer on it, but pointer should not rotate. how can I do that? this is my code of Layout:

rll = (RelativeLayout) findViewById(co.iman.R.id.relativeLayout1);
rlllp = new RelativeLayout.LayoutParams(
    RelativeLayout.LayoutParams.WRAP_CONTENT, RelativeLayout.LayoutParams.WRAP_CONTENT);
rlllp.setMargins(190, 200, 200, 0);

and in other method I rotate the layout with:

    rll.setRotation(mCurrentDegree);

I want put a pic or button exactlly in center of this layout? and I want to move this button independently.

soodabeh
  • 23
  • 4

1 Answers1

0

Try making another RelativeLayout inside your first one, and do something like this: rll.setRotation(mCurrentDegree); rll2.setRotation(-mCurrentDegree);

Now the inside layout should be set to -10 degrees when its parent is set to 10, so it will look like it is not moving at all. Hope that helps!

Code Cube
  • 51
  • 7
  • Ok. it's good. but I don't think that is useful. bcz I want to move the pointer. it will not be in fix position :( – soodabeh Aug 21 '14 at 14:20
  • As long as you keep the code I mentioned, you should be able to use other functions to move it around as well. – Code Cube Aug 21 '14 at 17:12
  • It's so hard work and confusing :) ... I did it finally...I put my relativeLayout and ImageView on a frameLayout... and problem solved – soodabeh Aug 23 '14 at 14:57