android - Button placed in FrameLayout does not work properly in 2.3.6 device, even though compiled from 2.3.3 (API 10) SDK -


i have installed api level 10 sdk ( aka 2.3.3 ).

i've made simple linear arrangement of buttons added programmatically on framelayout.

mintargetversion = "8" maxtargetversion = "10"

runs on ics 4.0.4 device. runs on simulator. when install apk in devices having os 2.3.5 or 2.3.6, buttons not obey left margin parameters , comes clubbed 1 onto another.

i've seen framelayout introduced in api level 1, while running devices @ api level 10 or higher, shouldn't problem.

my sample code of adding button

button b1 = new button(this); framelayout framelayout = (framelayout)this.findviewbyid(r.id.mainactivityview); framelayout.layoutparams params = framelayout.layoutparams(100,100); //a 100x100 button params.leftmargin = 10; // in other buttons, values incremented  100, 200 params.topmargin = 10; framelayout.addview(b1,params); 

can let me know causing such improper behaviour?

try adding gravity params.

params.gravity = gravity.start | gravity.top; 

i had same problem , solved it.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -