0
package com.app_name.app;

import com.getcapacitor.BridgeActivity;
import android.os.Bundle;               
import android.graphics.Color;       
// import android.webkit.WebView;

public class MainActivity extends BridgeActivity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        // Set WebView background color
        // This gets rid of the white flash that occassionally occurs when there is in a lag in drawing the app and during the expansion and collapse of the keyboard
        this.getBridge().getWebView().setBackgroundColor(Color.BLACK); // or any color

    }
}

The above file is located in:

app/src/main/java/com/app_name/app/MainActivity.java

However, the above file is simple. It merely sets the background color to black, which works as expected.

Goal:

Instead of a simple uniform background color, I want the background to be my brand logo, rounded, and centered on some chosen background color.

Note that this is not the splashscreen. If this file was not set, then occasionally, when the app wakes up or lags, a white flash appears on the screen before the app is rendered. This file is meant to replace that white screen flash with chosen background with the brand logo centered and rounded.

1 Answer 1

0

It depends on what you want to change the
1. background image
or
2. background color.
Use the appropriate CSS properties to achieve the result you want.

New contributor
Raham Kalhoro is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
Sign up to request clarification or add additional context in comments.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.