ãã1. å¨res/valuesä¸å建两个xmlæ件ï¼ä¸ä¸ªä¸ºä¸»ä½é£æ ¼èµæºstyles.xmlä¸ä¸ªä¸ºé¢è²èµæºcolors.xml
ããstyles.xml :
ãã
ãã<?xml version="1.0" encoding="utf-8"?>
ãã<resources>
ãã<style name = "translucent" parent = "@android:style/Theme.Dialog">
ãã<item name = "android:windowBackground">@color/translucent_background</item>
ãã<item name = "android:windowIsTranslucent">true</item>
ãã<item name = "android:windowNoTitle">true</item>
ãã<item name ="android:windowAnimationStyle">@android:style/Animation.Translucent</item>
ãã</style>
ãã</resources>
ãã
ããcolors.xml
ãã<?xml version="1.0" encoding="utf-8"?>
ãã<resources>
ãã<color name = "translucent_background">#00000000</color>
ãã</resources>
ãã2. å¨AndroidManifest.xml为Activityæå®èªå®ä¹ç主é¢
ãã<activity android:name = â.copyrightâ android:theme = â@style/translucentâ />
ãã
ãã3. å¨æ¾ç¤ºå¾ççactivityå¸å±æ件ä¸å å
¥å¾çèµæºï¼è®¾ç½®layoutçèæ¯æè
å¢å ä¸ä¸ªImageViewæ¾ç¤ºå¾çï¼
ãã4.å¨Activity javaæ件copyright.javaä¸å
³èå¸å±æ件ï¼ç¶åè¿è¡Androidå·¥ç¨å°æ¤activity.
温馨提示:内容为网友见解,仅供参考