Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

Background image on Android Activity, shortly visible after app starts ?

$
0
0

Hi everyone

As my Android (Forms) app has quite a long startup time, we decided to insert at logo on the main activity background, by using a custom xml :

<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">

    <item
        android:drawable="@color/white"/>
    <item>
        <bitmap
            android:id="@+id/background_layout"
            android:gravity="center"
            android:src="@drawable/icon"/>
    </item>
</layer-list>

And i reference the above xml in my theme :

<item name="android:windowBackground">@drawable/startup_background</item>

It works great, but my problem is, that when I push a new ContentPage onto a NavigationPage, you slightly see the logo, before the actual Content of the new Page has been rendered.

Is it somehow possible to remove the reference to this background xml at runtime, so its only visible at startup ? And how do I find the Id of the layout holding the Forms "framework" ? Wouldnt it be possible to remove it after the call to :

LoadApplication (new App ());

Maybe I'm doing this the wrong way? Please let me know how you guys tackle this ?

Cheers,
Kent Fonager, Mesh ApS


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>