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

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -