Ⅰ android 相對布局狀態欄高度變了
解決方法;
操作鍵放在工具欄的最頂端或最低端。工具欄在被壓住時可以動態改變其高度.
Ⅱ android標題欄高度是多少
一般的是24dp,有的手機可能不是,可以用代碼獲取下。
Ⅲ android 狀態欄高度是多少
是的,800高度里包括了狀態欄設計范圍應該是780高度。
Ⅳ android沉浸式狀態欄透明怎麼設置頂部高度
你這狀態欄是變色龍狀態欄,不是沉浸式的
這應該是沉浸式的狀態欄吧,系統欄與actionbar顏色設為一致
我只想說去你妹的,老子只要自己的app的狀態欄能和主題顏色一致就行了,定義那麼多術語,讓我等小白情以何堪?
吐槽歸吐槽,但還是不得不去試著理解下這些術語怎麼來的,引用這里的一段話:
沉浸式全屏模式
隱藏status bar(狀態欄)使屏幕全屏,讓Activity接收所有的(整個屏幕的)觸摸事件。
透明化系統狀態欄
透明化系統狀態欄,使得布局侵入系統欄的後面,必須啟用fitsSystemWindows屬性來調整布局才不至於被系統欄覆蓋。
因此,我就這樣理解了:
沉浸式不就是隱藏狀態欄嘛,狀態欄不見了?這不就是app全屏模式嘛?wtf?
Ⅳ App 安卓720*1280的狀態欄、導航欄、主菜單高度分別是50、96、96,那麼1080x1920的呢
Android的多解析度,一向是設計師和開發者非常頭疼的事兒。盡管如此,對於多分辨造成的復雜問題,也是大家要優先解決的。Android支持多種不同的dpi模式:ldpi 、mdpi 、hdpi 、xhdpi 、xxhdpi 、xxxhdpi 。
Ⅵ 安卓狀態欄高度是多少
這個高度的屬性值已經在attr中定義了,如果你要自己設置該高度,可以直接調用:
android:layout_height="?attr/actionBarSize"
Ⅶ Android如何獲取系統高度、標題欄和狀態欄高度
getWindow().getDecorView().getWindowVisibleDisplayFrame(rect);///取得整個視圖部分,注意,如果你要設置標題樣式,這個必須出現在標題樣式之後,否則會出錯
int top = rect.top;////狀態欄的高度,所以rect.height,rect.width分別是系統的高度的寬度
View v = getWindow().findViewById(Window.ID_ANDROID_CONTENT);///獲得根視圖
int top2 = v.getTop();///狀態欄標題欄的總高度,所以標題欄的高度為top2-top
int width = v.getWidth();///視圖的寬度,這個寬度好像總是最大的那個
int height = v.getHeight();////視圖的高度,不包括狀態欄和標題欄
如果只想取得屏幕大小,可以用
Display display = getWindowManager().getDefaultDisplay() ;
Ⅷ android狀態欄高度是多少
Android中兩種獲取狀態欄高度的方法
方法一:
(Contextcontext){
doublestatusBarHeight=Math.ceil(25*context.getResources().getDisplayMetrics().density);
returnstatusBarHeight;
}
這種方法很簡單,只有一行代碼:
狀態欄高度=取大於其的最小整數(25*上下文_獲取應用包的資源實例_獲取當前屏幕尺寸_屏幕密度比例)
其中density並不是真實的屏幕密度,而是一個相對密度,基準密度為160dpi,比如我測試的手機為HTC one m8,查的屏幕密度為441dpi,相對160為2.75,density就取為3。各解析度的density取值為:
ldpi(dpi=120,density=0.75)
mdpi(dpi=160,density=1)
hdpi(dpi=240,density=1.5)
xhdpi(dpi=320,density=2)
xxhdpi(dpi=480,density=3)
所以得到的狀態欄高度為25*3=75
由這種方法得到的狀態欄高度具有較大局限性,比如因為某種需要去掉狀態欄或本身沒有狀態欄,此時狀態欄高度應為0,但是該方法依然能夠得到一個非零的狀態欄高度。
方法二:
privateintgetStatusBarHeight(Contextcontext){
intresult=0;
intresourceId=context.getResources().getIdentifier("status_bar_height","dimen","android");
if(resourceId>0){
result=context.getResources().getDimensionPixelSize(resourceId);
}
returnresult;
}
這里我們用到了getIdentifier()的方法來獲取資源的ID,其中第一個參數是要獲取資源對象的名稱,比如我們要獲取狀態欄的相關內容,這里填入"status_bar_height";第二個參數是我們要獲取什麼屬性,我們要獲取高度內容,所以填入"dimen";第三個是包名,狀態欄是系統內容,故填入「android」。
另外一個用到的辦法是getDimensionPixelSize(),由函數名就能知道是根據資源ID獲得資源像素尺寸,這里就直接獲得狀態欄的高度。
這種方法在狀態欄不存在的時候就會獲得其高度為0.
Ⅸ 如何修改 Android 狀態欄高度
修改 Android 狀態欄高度:
配置文件:frameworks/base/core/res/res/values/dimens.xml
修改條目:
<resources>
<!-- The width that is used when creating thumbnails of applications. -->
<dimen name="thumbnail_width">0dp</dimen>
<!-- The height that is used when creating thumbnails of applications. -->
<dimen name="thumbnail_height">0dp</dimen>
<!-- The standard size (both width and height) of an application icon that
will be displayed in the app launcher and elsewhere. -->
<dimen name="app_icon_size">48dip</dimen>
<dimen name="toast_y_offset">64dip</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_height">38dip</dimen>
<!-- Height of the status bar -->
<dimen name="status_bar_icon_size">38dip</dimen>
<!-- Margin at the edge of the screen to ignore touch events for in the windowshade. -->
<dimen name="status_bar_edge_ignore">5dp</dimen>
<!-- Size of the fastscroll hint letter -->
<dimen name="fastscroll_overlay_size">104dp</dimen>
<!-- Width of the fastscroll thumb -->
<dimen name="fastscroll_thumb_width">64dp</dimen>
<!-- Height of the fastscroll thumb -->
<dimen name="fastscroll_thumb_height">52dp</dimen>
<!-- Default height of a key in the password keyboard -->
<dimen name="password_keyboard_key_height">56dip</dimen>
<!-- Default correction for the space key in the password keyboard -->
<dimen name="password_keyboard_spacebar_vertical_correction">4dip</dimen>
</resources>