[android-developers] Re: offsetLeftAndRight() not working
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 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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: offsetLeftAndRight() not working
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 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 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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.comandroid-developers%2bunsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Thanks and Regards Gurudutt P.S. -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: offsetLeftAndRight() not working
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 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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: offsetLeftAndRight() not working
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 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 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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: offsetLeftAndRight() not working
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 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 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 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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: offsetLeftAndRight() not working
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 trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
Re: [android-developers] Re: offsetLeftAndRight() not working
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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en
[android-developers] Re: offsetLeftAndRight() not working
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 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); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); layout.addView(tv, LayoutParams.WRAP_CONTENT); setContentView(layout); I am trying this way, but no effect... then, i also tried setContentView(layout); tv.offsetLeftAndRight(50); still its not moving.. On Nov 12, 12:35 pm, Romain Guy romain...@google.com wrote: You must call this *after* a layout. Also, this will be reset by the next layout pass. On Wed, Nov 11, 2009 at 11:34 PM, Nithin nithin.war...@gmail.com wrote: Hi, I created textview in java and trying offsetLeftAndRight(int), but the textview is not moving at all. I am using linear layout. the code is, layout = new LinearLayout(this); layout.setOrientation(LinearLayout.VERTICAL); TevtView tv = new TextView(this); tv.offsetLeftAndRight(50); but the textview is not moving either horizontally or vertically.. Any idea please.. Thanks Nithin -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -- Romain Guy Android framework engineer romain...@android.com Note: please don't send private questions to me, as I don't have time to provide private support. All such questions should be posted on public forums, where I and others can see and answer them -- You received this message because you are subscribed to the Google Groups Android Developers group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en