Home > Mobile >  how to solve cannot resolve error in xml file?
how to solve cannot resolve error in xml file?

Time:09-16

I'm trying to make background and logo in splash screen in flutter app.

so, result of searching about this, It has to edit xml file in android/res/drawable folder. so I edit the codes like below. but it occures error 'Cannot resolve symbol ', and I put the src file in same position in folder. How can I arrange this?

 <item>
    <bitmap
        android:gravity="center"
        android:src="@drawable/eye.png" />
</item> -->

folder files

CodePudding user response:

You just need to remove that .png from end

<bitmap
    android:gravity="center"
    android:src="@drawable/eye" />

CodePudding user response:

You just need to remove that .png from the end

<bitmap
    android:gravity="center"
    android:src="@drawable/eye" />

and for android s to remove default splash screen

import android.os.Build
import android.os.Bundle
import android.window.SplashScreenView
import androidx.core.view.WindowCompat
import io.flutter.embedding.android.FlutterActivity


class MainActivity : FlutterActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        // Aligns the Flutter view vertically with the window.
        WindowCompat.setDecorFitsSystemWindows(window, false)
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
            // Disable the Android splash screen fade out animation to avoid
            // a flicker before the similar frame is drawn in Flutter.
            splashScreen
                .setOnExitAnimationListener { splashScreenView: SplashScreenView -> splashScreenView.remove() }
        }
        super.onCreate(savedInstanceState)
    }
}
  • Related