【问题标题】:firemonkey android fullscreen with statusbarfiremonkey android全屏状态栏
【发布时间】:2018-04-30 19:10:07
【问题描述】:

我怎样才能像提供的图片一样设计我的用户界面

这是全屏并有状态栏。 当我将全屏设置为 true 时,它​​会隐藏状态栏

我还将状态栏visibility 设置为visibale 或VisibleAndOverlap 并选择一种颜色,但它看起来不像我发送的图像!

这种设计在firemonkey中可用吗!?

【问题讨论】:

    标签: delphi firemonkey


    【解决方案1】:

    您可以通过更新默认样式来做到这一点。您必须通过类似的方式更新 AndroidManifest.template.xml

    <application android:persistent="%persistent%" 
                 android:restoreAnyVersion="%restoreAnyVersion%" 
                 android:label="%label%" 
                 android:debuggable="%debuggable%" 
                 android:largeHeap="%largeHeap%"
                 android:icon="%icon%"
                 android:theme="@style/myAppTheme"
                 android:hardwareAccelerated="%hardwareAccelerated%">
    

    然后你必须提供一个 style.xml 和你需要的设置(比如使状态栏半透明)

    style.xml 示例:

    <?xml version="1.0" encoding="utf-8"?>
    <resources>
    
      <style name="myAppTheme" parent="@android:style/Theme.Material.Light.NoActionBar"> 
        <item name="android:windowTranslucentStatus">true</item>
        <item name="android:windowTranslucentNavigation">true</item>
        <item name="android:windowDrawsSystemBarBackgrounds">false</item>
        <item name="android:colorPrimary">#ff2b2e38</item>
        <item name="android:colorAccent">#ff0288d1</item>
        <item name="android:windowBackground">@drawable/splash_screen</item>
        <item name="android:statusBarColor">#ff0087b4</item>
      </style>
    
    </resources>
    

    查看覆盖 https://github.com/Zeus64/alcinoe 的默认样式的演示应用示例(演示为 alfmxcontrols)

    【讨论】:

    • 我尝试多次安装 alcinoe,但我还不能安装:|
    • @zeus 您的解决方案是使系统栏半透明(半透明)并为此完美运行,但不要使系统栏背景像屏幕截图一样完全透明。我制作了一个完整解决方案的教程,将状态栏和导航栏设置为全透明背景,包括在启动画面中以及设置系统栏前景的亮度,并教授如何预测系统栏的大小以填充表格.
    【解决方案2】:

    你可以用我在github的代码设置状态栏和导航栏背景透明:

    https://github.com/viniciusfbb/fmx_tutorials/tree/master/delphi_system_bars/

    在这种情况下你需要使用:

    uses
      iPub.FMX.SystemBars;
    
      ...
    
      Form1.SystemBars.StatusBarBackgroundColor := TAlphaColors.Null;
      Form1.SystemBars.NavigationBarBackgroundColor := TAlphaColors.Null;
      Form1.SystemBars.Visibility := TipFormSystemBars.TVisibilityMode.VisibleAndOverlap;
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-09-09
      • 2016-07-25
      相关资源
      最近更新 更多