How to set Margin Left ,Margin top,Margin right and Margin Bottom alignment for popup window dynamically in android -
i doing android application contains popup window named mypopup. contains image button , 4 textviews. want align popup window dynamically margin top,margin bottom,margin left , margin right parameters..in code setmargin method not working..please me this...
it depends layout using. below example places relativelayout in linearlayout.
linearlayout linearlayoutparent; relativelayout relativelayout; relativelayout.layoutparams margin = new relativelayout.layoutparams(relativelayout.layoutparams.fill_parent, relativelayout.layoutparams.wrap_content); margin.setmargins(0, 0, 0, 7); //7px bottom margin //create linear , relative layouts //...add other stuff here... // add view margins linearlayoutparent.addview(relativelayout, margin);
Comments
Post a Comment