标签:transparent splash-screen android
我试图让我的闪屏的背景变得不透明/透明.我在值中创建了一个colors.xml:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="translucent_black">#00000000</color>
</resources>
然后我有我的splash.xml
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent" android:background="@color/translucent_black">
<ImageView android:layout_width="wrap_content" android:id="@+id/imageView1"
android:src="@drawable/splash" android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_centerInParent="true"></ImageView>
</RelativeLayout>
我觉得我应该在清单中有一些东西,但是我一直都会把错误放进去.如果你真的感觉很活泼,我也可以弄清楚如何让标题栏消失.再次感谢.
解决方法:
简单的方法
指定要使用半透明主题的活动(在manifest.xml中):
<activity ...
android:theme="@android:style/Theme.Translucent"
.../>
高级方法
如果您想要更多自定义,可以创建自己的主题,扩展Translucent主题(manifest.xml):
<activity ...
android:theme="@android:style/Theme.MyTranslucentTheme"
.../>
并在styles.xml中:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="MyTranslucentTheme" parent="android:Theme.Translucent">
<item name="android:windowBackground">@color/transparent_black</item>
</style>
<color name="transparent_black">#DA000000</color>
</resources>
标签:transparent,splash-screen,android 来源: https://codeday.me/bug/20190721/1495914.html
本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享; 2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关; 3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关; 4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除; 5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。