Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save MadinaB/1b71082babea80cad96bcfde66dc18b5 to your computer and use it in GitHub Desktop.
Save MadinaB/1b71082babea80cad96bcfde66dc18b5 to your computer and use it in GitHub Desktop.
Getting height of a view in OnCreate()
final View view=//smth;
...
view.post(new Runnable() {
@Override
public void run() {
view.getHeight(); //height is ready
}
});
http://qaru.site/questions/20221/getwidth-and-getheight-of-view-returns-0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment