Hi, I tried in this way too, still no success
MarginLayoutParams compParams = new MarginLayoutParams (MarginLayoutParams.WRAP_CONTENT, MarginLayoutParams.WRAP_CONTENT); compParams.topMargin=100; compParams.leftMargin=100; compParams.bottomMargin=0; compParams.rightMargin=0; //compParams.setMargins(100, 100, 0, 0); TextView tv = new TextView(this) tv.setLayoutParams(compParams); setContentView(tv); any idea please.. Thanks On Nov 17, 7:58 pm, Nithin <nithin.war...@gmail.com> wrote: > anybody know this.. I googled alot, but cant get the exact thing.. > > Thanks > > On Nov 17, 6:45 pm, Nithin <nithin.war...@gmail.com> wrote: > > > Hi, > > > I created a textview and also MarginlayoutParams. Then i put setMargin > > for the MarginLayoutParams and inserted that to textview using > > tv.setLayoutparams(), but its not working. > > > The code is, > > > MarginLayoutParams compParams = new MarginLayoutParams > > (MarginLayoutParams.WRAP_CONTENT, > > MarginLayoutParams.WRAP_CONTENT); > > compParams.setMargins(100, 100, 0, 0); > > TextView tv = new TextView(this) > > tv.setLayoutParams(compParams); > > setContentView(tv); > > > But the textView is still in top left corner, its not moving. > > > Any suggestions please.. > > > Thanks > > -- 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