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.
- each row of buttons got own linearlayout.
- wrapped button rows in parent linearlayout.
- set parent , leading button (to i'll matching widths of other buttons) layout_width "wrap_content"
- set other button rows' layout_widths 'fill_parent'
done.
Comments
Post a Comment