[android-developers] Re: offsetLeftAndRight() not working

2009-11-12 Thread Nithin
After a layout means, after attaching the view to layout or after setContentView()... On Nov 12, 12:58 pm, Nithin nithin.war...@gmail.com wrote: Layout pass means... I dont know what layout pass means.. where i have to put the offsetLeftAndRight()... On Nov 12, 12:54 pm, Romain Guy

Re: [android-developers] Re: offsetLeftAndRight() not working

2009-11-12 Thread Guru
textView.post(new Runnable() { public void run() { textView.offsetLeftAndRight(50); } }); On Thu, Nov 12, 2009 at 2:59 PM, Nithin nithin.war...@gmail.com wrote: After a layout means, after attaching the view to layout

[android-developers] Re: offsetLeftAndRight() not working

2009-11-12 Thread Ronnie
offsetLeftAndRight should be used only for moving a view temporarily. If you want to define the placement of the view for its lifetime, then you can specify padding or margin in the layout's xml file. R On Nov 12, 12:58 pm, Nithin nithin.war...@gmail.com wrote: Layout pass means... I dont know

[android-developers] Re: offsetLeftAndRight() not working

2009-11-12 Thread Nithin
Yes, you are right Ronnie.. I created a editText and moved using offsetLeftAndTop, but, when I started typing, in the edittext, its moving back to the default location.. I feel it as a strange behavior... On Nov 12, 2:14 pm, Ronnie ronnievie...@gmail.com wrote: offsetLeftAndRight should be

[android-developers] Re: offsetLeftAndRight() not working

2009-11-12 Thread Ronnie
As you start typing the layout pass will occur i.e. the onLayout method will be called, hence the view is repositioned to its original position. Use view's setPadding method for the same if you are not declaring in xml. R On Nov 13, 9:43 am, Nithin nithin.war...@gmail.com wrote: Yes, you are

[android-developers] Re: offsetLeftAndRight() not working

2009-11-11 Thread Nithin
Hi Romain Guy, Actually, I didnt get what you say, I am trying in this way.. layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am

Re: [android-developers] Re: offsetLeftAndRight() not working

2009-11-11 Thread Romain Guy
Because like I said, it has to happen after the layout pass. On Wed, Nov 11, 2009 at 11:52 PM, Nithin nithin.war...@gmail.com wrote: Hi Romain Guy, Actually, I didnt get what you say, I am trying in this way.. layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL);

[android-developers] Re: offsetLeftAndRight() not working

2009-11-11 Thread Nithin
Layout pass means... I dont know what layout pass means.. where i have to put the offsetLeftAndRight()... On Nov 12, 12:54 pm, Romain Guy romain...@google.com wrote: Because like I said, it has to happen after the layout pass. On Wed, Nov 11, 2009 at 11:52 PM, Nithin nithin.war...@gmail.com