1. 程式人生 > >獲取導航欄和狀態列的高度

獲取導航欄和狀態列的高度

    // 狀態列(statusbar)
    CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];
    NSLog(@"status width - %f", rectStatus.size.width); // 寬度
    NSLog(@"status height - %f", rectStatus.size.height);   // 高度

    // 導航欄(navigationbar)
    CGRect rectNav = self.navigationController.navigationBar
.frame; NSLog(@"nav width - %f", rectNav.size.width); // 寬度 NSLog(@"nav height - %f", rectNav.size.height); // 高度

相關推薦

iOS 獲取導航狀態高度

CGRect rect = [[UIApplicationsharedApplication] statusBarFrame]; 狀態列的高度: float status height =  rec

獲取導航狀態高度

// 狀態列(statusbar) CGRect rectStatus = [[UIApplication sharedApplication] statusBarFrame];

iOS 獲取導航狀態高度

bsp statusbar pan frame bar gin cgrect tom uia CGRect rect = [[UIApplication sharedApplication] statusBarFrame]; 狀態欄的高度: float status

獲取導航狀態,標籤高度

獲取導航欄的高度: self.navigationController.navigationBar.frame.size.height 寬度: self.navigationController.navigationBar.frame.size.width

flutter佈局-9-appbar導航狀態

示例 github:flutterlayout https://github.com/LiuC520/flutterlayout MaterialApp AppBar: 包含狀態列和導航欄 先看下上圖的具體用法 appBar: AppBar(

[RK3399][Android7.1] 除錯筆記 隱藏導航狀態

平臺 核心版本 安卓版本 RK3399 Linux4.4 Android7.1 文章目錄 導航欄與狀態列

Android 4.4 以上實現透明導航狀態 Translucent system bar

第一種方式 第一種方式,需要做下面三步設定 1、在values、values-v19、values-v21的style.xml都設定一個 Translucent System Bar 風格的Theme values/style.xml <style name="ImageTranslucentThem

iOS導航狀態及Tabbar高度(區分iPhone X與其他iPhone機型)

#define kIs_iphone (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) #define kIs_iPhoneX kScre

導航狀態字型顏色大小背景顏色

1、導航欄的背景色和標題顏色大小 //設定導航欄標題顏色和大小 [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName

極簡操作無需root隱藏S8導航狀態

運行 .html 驅動 root 選項 狀態欄 方法 多人 imm 距離三星Galaxy S8國行發布快一個禮拜了,相信論壇不少小同伴已經拿到手,許多人和我一樣被那塊全視曲面屏給誘惑剁手的,當拿到手把玩一段時間後卻發現這麽美的一塊屏幕居然大部分應用上下都有一行礙眼的狀態欄和

Android9.0 完全隱藏導航狀態

需求:自定義介面全屏顯示,隱藏導航欄,狀態列 按照google的官方辦法,設定如下幾個Flag就可以隱藏導航欄: View decorView = getWindow().getDecorView(); // Hide both the navigation bar an

[Android6.0][RK3399] 隱藏導航狀態

Platform: RK3399 OS: Android 6.0 Version: v2017.02 什麼是導航欄與狀態列 最上面是狀態列 StatusBar 最下面是導航欄 NavagationBar 一、隱藏導航欄 方

Android 標題狀態隨ScrollView滑動顏色改變輕鬆實現

01、概述: 在開發過程中,這樣的需求也是常見的,隨著ScrollView 的滑動,標題欄和狀態列背景透明度發生變化。有多中實現方式,在這裡記錄一下自己用到的一種。 02、效果: 03、程式碼實現: public class ZpScrollViewActivity e

一行程式碼修改導航狀態的透明度

在以前,我們可以通過當前控制器的導航控制器再獲取到navigatioBar導航條,修改導航條的barTintColor這個屬性去修改它的透明度,如: self.navigationController.navigationBar.barTintColor =

Android隱藏標題狀態的方法

package com.example.layoutdemo; import android.os.Bundle; import android.view.Window; import android.view.Wi

Android Studio下實現隱藏標題狀態的閃屏頁

之前在Eclipse下實現理想的全屏閃屏頁,同樣的程式碼拷貝到AS下仍然可以看見標題欄和狀態列,不知道是不是因為AppCompatActivity的原因。 方案一:在程式碼中動態隱藏標題欄和狀態列,但是失敗了。 方案二: 首先在style.xml裡新建resource

Android 4.0中去掉標題狀態的方法

    <style name="Theme.Holo.NoTitleBar">         <itemname="android:windowFullscreen">false</item>           <itemname="android:windo

GTK程式demo,帶工具狀態

main.c原始碼:#include <gtk/gtk.h> /* *@Description:從一個圖片檔案獲取資訊得到pixbuf *@param: gchar filename */ GdkPixbuf *create_pixbuf(const g

Android獲取螢幕寬高,狀態寬高,actionbar寬高,layout寬高,導航高度的方法彙總

看這個部落格你可以知道 獲取螢幕寬高,狀態列寬高,actionbar寬高,layout寬高,導航欄(虛擬按鍵欄)高度的方法   目錄順序為 程式碼測試的機型 狀態列高度 actionbar高度 螢幕高度 導航欄(虛擬按鍵欄)高度 layout寬高 總

iOS 隱藏導航後,UITableView向下偏移狀態高度 筆記

解決辦法 if (@available(iOS 11.0, *)) { self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; } else {