【发布时间】:2018-04-30 19:10:07
【问题描述】:
我怎样才能像提供的图片一样设计我的用户界面
这是全屏并有状态栏。 当我将全屏设置为 true 时,它会隐藏状态栏
我还将状态栏visibility 设置为visibale 或VisibleAndOverlap 并选择一种颜色,但它看起来不像我发送的图像!
这种设计在firemonkey中可用吗!?
【问题讨论】:
标签: delphi firemonkey
我怎样才能像提供的图片一样设计我的用户界面
这是全屏并有状态栏。 当我将全屏设置为 true 时,它会隐藏状态栏
我还将状态栏visibility 设置为visibale 或VisibleAndOverlap 并选择一种颜色,但它看起来不像我发送的图像!
这种设计在firemonkey中可用吗!?
【问题讨论】:
标签: delphi firemonkey
您可以通过更新默认样式来做到这一点。您必须通过类似的方式更新 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)
【讨论】:
你可以用我在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;
【讨论】: