我无法找到任何有关此的信息。我有一个启动屏幕活动,它将在首次加载应用程序时加载Gif图像。 gif具有透明背景,但是在加载应用程序时,gif似乎加载在白色背景上。
我尝试编辑一些XML代码以包含某种透明主题,但似乎没有任何改变。这是我的活动:
private final int TIME = 8000;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
new Handler().postDelayed(new Runnable() {
@Override
public void run() {
Intent mainIntent = new Intent(LoadingScreen.this,Mainactivity.class);
LoadingScreen.this.startactivity(mainIntent);
LoadingScreen.this.finish();
}
},TIME);
}
还有我的XML文件:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
tools:context=".LoadingScreen">
<pl.droidsonroids.gif.GifImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:src="@drawable/logo"/>
</LinearLayout>
如果可能,我gif的透明部分应显示在用户主屏幕上。因此,您可以在后台查看其所有应用程序。
我猜想这将是XML文件中的某种样式代码,但是我无法弄清楚到底要使用什么。感谢您的协助!