Android 在高度较大的设备中,飞溅向上移动
以下是Android 在高度较大的设备中,飞溅向上移动,android,splash-screen,Android,Splash Screen,以下是启动\u background.xml代码: <?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:drawable="@color/splash_color" /> <item android:width="160dp"
启动\u background.xml
代码:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@color/splash_color" />
<item
android:width="160dp"
android:height="58dp"
android:drawable="@drawable/hal_logo"
android:gravity="center" />
</layer-list>
屏幕稍微向上移动,同时在高度较大的屏幕中显示。我也试过使用位图。同样的问题也存在。我使用位图标记来完成,在更大的屏幕上没有问题
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@android:color/white" />
<item>
<bitmap
android:gravity="center"
android:src="@drawable/colored_logo" />
</item>
</layer-list>
可能您对徽标的大小有问题,我的徽标是800x400 px使用
viewTreeObserver
和Build.VERSION.SDK_INT
从MainActivity.kt
检查并仅保留super
方法后的行:
class MainActivity : FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
}
}
现在它按预期工作,不再向上移动。你用位图试过了吗?是的。同样的问题也存在