Android全透明Activity示例
16lz
2021-01-23
AndroidManifest.xml
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ccwwff/archive/2010/10/26/5965668.aspx
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.xxxx"> <application android:persistent="true" android:label="@string/home_title" android:icon="@drawable/ic_launcher_home"> <activity android:name="xxxxxxxx" android:theme="@android:style/Theme.Translucent"> <intent-filter> <action android:name="android.intent.action.LAUCHER" /> <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </activity> </application></manifest> xxxxxxxx.javapackage com.example.android.xxxx; public class fpToolbar extends Activity { @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_NO_TITLE); LinearLayout layout2; layout2 = new LinearLayout(this); Button b = new Button(this); Button b2 = new Button(this); layout2.addView(b); layout2.addView(b2); layout2.setGravity(Gravity.BOTTOM | Gravity.LEFT); layout2.setBackgroundDrawable(null); /* 设置成透明,必须在AndroidManifest.xml中设置android:theme="@android:style/Theme.Translucent" */ b.setText("test pop."); b2.setText("hello!"); setContentView(layout2); }}
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/ccwwff/archive/2010/10/26/5965668.aspx
更多相关文章
- 分析脚本文件AndroidInitProcess分析心得(1)
- Android通知栏消息(基本文字通知)
- Android判断网络状态是否断开+Android完全关闭应用程序+ 本文讲
- Android下载文本文件和mp3文件
- Android-TextView多行本文滚动轻松实现
- 解析PHP的基本文本输出
- Linux hostname主机名配置文件/etc/hosts详解 详细出处参考:http:
- TP-link 无线路由器WDS设置方法图解_无线桥接设置 详细出处参考:h
- php 读取文本文件