XE8 for iOS 狀態列的幾種效果

來源:互聯網
上載者:User

標籤:

XE8 實現 iOS 狀態列的幾種效果:

一、狀態列底色:

  1. 開一個新工程。
  2. 設定 Fill.Color 顏色屬性。
  3. 設定 Fill.Kind = Solid。
  4. 無需修改任何官方源碼。

 

 

二、隱藏狀態列(全屏):

  1. 開一個新工程。
  2. 設定 BorderStyoe = None。
  3. 無需修改任何官方源碼。

 

 

三、透明狀態列(能見底圖):

  1. 開一個新工程。
  2. 設定底圖 Fill.Bitmap.Bitmap。
  3. 設定 Fill.Bitmap.WrapMode = TitleStretch。
  4. 設定 Fill.Kind = Bitmap。
  5. 設定 BorderStyle = ToolWindows。(利用設定此項來顯示透明效果,請見下方源碼修改)
  6. 需要 FMX.Platform.iOS.pas 源碼。

 

 

iOS 5.x 與上述做法相同,只需再多加一個設定:

Project > Options > Version Info (在表格上按滑鼠右鍵來增加)

Key Value
UIStatusBarStyle UIStatusBarStyleBlackTranslucent

 

 

 

 

修改方法:

請將源碼 FMX.Platform.iOS.pas 複製到自己的工程目錄裡,再進行修改。

找到 TPlatformCocoaTouch.CalculateFormViewFrame 加入下面代碼:

function TPlatformCocoaTouch.CalculateFormViewFrame(const AForm: TCommonCustomForm): NSRect;var  Orientation: NSUInteger;  StatusBarHeight: Single;  Tmp: Single;begin  if IsPopupForm(AForm) then    Result := CGRectMake(AForm.Left, AForm.Top, AForm.Width, AForm.Height)  else  begin    Result := FMainScreen.bounds;    StatusBarHeight := 0;{+++>} // 加入下面代碼    if AForm.BorderStyle = TFmxFormBorderStyle.ToolWindow then    begin      StatusBarHeight := 0;      FStatusBarHeight := 0;      Result.origin := CGPointMake(0, 0);    end    else{<+++} // 加入上面代碼     if AForm.BorderStyle <> TFmxFormBorderStyle.None then    begin... 略 ...end;

 

XE8 for iOS 狀態列的幾種效果

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.