Android启动画面实现
来源:互联网 发布:oa与大数据库设计 编辑:程序博客网 时间:2024/05/16 01:49
在应用程序中经常用到启动画面,会启动一个后台线程为主程序的运行准备资源。
Android要实现启动画面可以这样做:
这是splash.xml布局文件的代码[code]<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
<ImageView android:layout_height="fill_parent" android:layout_width="fill_parent" android:scaleType="fitCenter" android:src="@drawable/splash"></ImageView>
</LinearLayout>[/code]
放一个ImageView加载启动画面图片
SplashActivity作为主视图启动/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Handler x = new Handler();
x.postDelayed(new splashhandler(), 2000);
}
class splashhandler implements Runnable{
public void run() {
startActivity(new Intent(getApplication(),MainActivity.class));
SplashActivity.this.finish();
}
}
Android要实现启动画面可以这样做:
这是splash.xml布局文件的代码[code]<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="fill_parent" android:layout_width="fill_parent" android:orientation="vertical">
<ImageView android:layout_height="fill_parent" android:layout_width="fill_parent" android:scaleType="fitCenter" android:src="@drawable/splash"></ImageView>
</LinearLayout>[/code]
放一个ImageView加载启动画面图片
SplashActivity作为主视图启动/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
Handler x = new Handler();
x.postDelayed(new splashhandler(), 2000);
}
class splashhandler implements Runnable{
public void run() {
startActivity(new Intent(getApplication(),MainActivity.class));
SplashActivity.this.finish();
}
}
0 0
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android实现启动画面
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面实现
- Android启动画面的实现
- android程序启动画面实现
- Android应用启动画面实现
- css 清零代码
- Android启动画面实现
- jquery jqgrid cellEdit为true的时候,默认选中单元格值
- The kernel module programming primer(4)-Writing interrupt module with parameters
- Word转换成PDF格式文件的方法
- Android启动画面实现
- 2.object学习-类
- 三维表面的降噪处理 (surface denoising)
- 有关MCU AUTOSAR架构的网址
- 机器学习(1)--绪论
- java poi 通过excel模板导出并且生成多个sheet
- java枚举使用
- Andorid屏幕唤醒异常,Power按键无法点亮屏幕的分析
- OGRE Defferedshading实现和应用