android - set layout gravity to right -



android - set layout gravity to right -

i set gravity right of layout not works fine : (below codes within loop)

linearlayout lin = new linearlayout(getactivity()); layoutparams lin_parms = new layoutparams(layoutparams.fill_parent,layoutparams.wrap_content); lin_parms.gravity = gravity.right; lin.setlayoutparams(lin_parms); lin.setgravity(gravity.right); layoutparams txt_parms = new layoutparams(layoutparams.fill_parent,layoutparams.wrap_content); txt_parms.gravity = gravity.right; textview txt_view = new textview(getactivity()); txt_view.setlayoutparams(txt_parms); txt_view.settypeface(font); txt_view.settext("hello"); lin.addview(txt_view); lay_lin_list_tractions.addview(lin);

set textview params wrap_content

layoutparams txt_parms = new layoutparams(layoutparams.wrap_content, layoutparams.wrap_content);

android android-linearlayout

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -