android layout hide/show views -
I have a linear vertical layout below. I need my application to switch buttons and textview, hide the I button and Change the text to show etc. If I use the visibility set for the button (see INVISIBLE) then it disappears from the screen but it is still holding the place. How can I switch without deleting those elements altogether?
& lt; Clock Android: id = "@ + id / chronometer1" Android: layout_width = "wrap_content" Android: layout_height = "wrap_content" Android: layout_gravity = "bottom | center_horizontal" Android: textSize = "30sp" Android: text = "chronometer" / & Gt; & Lt; Button Android: "Android: attr / buttonStyleSmall" id = "@ + id / stopButton" style = Android: layout_width = "match_parent" android: layout_height = "wrap_content" android: text = "@ string / stop_button" /> & Lt; Android: layout_height = "wrap_content" android: layout_gravity = "bottom | center_horizontal" Android: textSize = "30sp" Android: text = "" / "and" Gt;
use -
button .setVisibility ( See.)
Comments
Post a Comment