android - How to get button width after it's layout visibility is changed from gone to visible -


have linearlayout few buttons in it.

initially visibility set view.gone after user clicks, visibility set visible

this need programmatically detect 1 of button's width , match other button width it.

initial call

public void onwindowfocuschanged(boolean hasfocus)  

does not work since layout not visible.

getmeasuredwdith() , getwidth() 

return 0 when called after visibility flags has been changed.

any ideas get width of button?

figured out.

ended going xml.

  1. each row of buttons got own linearlayout.
  2. wrapped button rows in parent linearlayout.
  3. set parent , leading button (to i'll matching widths of other buttons) layout_width "wrap_content"
  4. set other button rows' layout_widths 'fill_parent'

done.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -