android - Height of statusbar? -


Is there a way to get the position of the titlebar + titlebar? Testing the God Forum is the only question, but there is no solution (which I can get).

I know that we can get it after the initial layout pass, but I mean it (my) activity.

Thanks

  rectgle rectgle = new rect (); Window window = getWindow (); . Window.getDecorView () getWindowVisibleDisplayFrame (rectgle); Int statsbrown = rectgle.top; Int contentViewTop = window.findViewById (window .ID_ANDROID_CONTENT) .getTop (); Int titleBarHight = ContentViews - StatusEverything; Logs. I ( "*** Jorgesis ::", "Stetsbar height =" + Sthitibarhait + ", Shirshkbari height =" + Taitlbarhait);  

Get the height of the status bar on the onCreate () method of your activity, use this method:

  public int getStatusBarHeight () {int results = 0; Int resourceId = getResources (). GetIdentifier ("status_bar_height", "dimen", "android"); If (sourceId> gt; 0) {result = gets the resource (). GetDimensionPixelSize (resourceId); } Return results; }  

Comments

Popular posts from this blog

paypal - How to know the URL referrer in PHP? -

oauth - Facebook OAuth2 Logout does not remove fb_ cookie -

wpf - Line breaks and indenting for the XAML of a saved FlowDocument? -