Xamarinフォームプロジェクトを作成しましたが、Androidステータスバーの色を透明に変更できません。私は次のように私のMainActivityのOnCreate関数()メソッドでは、プログラムで私の色を変えています:XamarinフォームAndroidトランスペアレントステータスバー
if (Build.VERSION.SdkInt >= BuildVersionCodes.Lollipop)
{
Window.ClearFlags(WindowManagerFlags.TranslucentStatus);
Window.AddFlags(WindowManagerFlags.DrawsSystemBarBackgrounds);
Window.SetStatusBarColor(Color.Transparent);
}
は、私は別の色を試してみました、それがまったく機能していない「透明」罰金が、働いています。私は私のstyle.xmlは以下の通りであるAPIに22
をテストしてい:
<style name="MainTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="windowNoTitle">true</item>
<item name="windowActionBar">false</item>
<item name="colorPrimary">@color/blue</item>
<item name="colorPrimaryDark">@color/blue</item>
<item name="colorAccent">#FF4081</item>
<item name="windowActionModeOverlay">true</item>
<item name="android:windowDrawsSystemBarBackgrounds">true</item>
私は例えば、プログラムパープルに私の色を設定した場合、それは問題なく動作しますが、私の場合それを透明に設定すると、私は自分のstyle.xml色を青色にします。私がstyle.xml ColorPrimaryDarkの色を削除した場合は、グレーのステータスバーが表示されます。解決策は何でしょうか?
[ロリポップ:透明に設定され、その色とステータスバーの後ろに描く]の可能な重複(http://stackoverflow.com/questions/27856603/lollipop-draw-behind-statusbar-with-its-color-set 〜透明) –