zoukankan      html  css  js  c++  java
  • phonegap 启动背景设置

    1、拷贝一张图片到Android项目的res目录的drawable-mdpi目录下

    2、在主要的src下的java文件中编写代码

    package com.study.hellomobileword1;
    
    import android.os.Bundle;
    //import android.app.Activity;
    import android.view.Menu;
    import org.apache.cordova.*;
    
    public class MainActivity extends DroidGap{
    
        @Override
        public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            //设置背景图片
            super.setIntegerProperty("splashscreen", R.drawable.splash_sn);
            
            //设置超时 android应用如果  6 秒还没有反映则认为是超时    可以手动设置,这里60秒才超时
            
            super.setIntegerProperty("loadUrlTimeoutValue", 60000);
            
            //第一个参数表示软件初始化启动的页面,第二个参数表示背景图片显示的时间(时间毫秒值)
            super.loadUrl("file:///android_asset/www/index.html",1000);
        }
    
        @Override
        public boolean onCreateOptionsMenu(Menu menu) {
            // Inflate the menu; this adds items to the action bar if it is present.
            getMenuInflater().inflate(R.menu.main, menu);
            return true;
        }
    
    }
  • 相关阅读:
    kvm添加磁盘
    python学习1
    ubuntu使sudo不需要密码
    磁盘挂载
    github/gitlab添加多个ssh key
    生成SSH key
    git 删除追踪状态
    angular2+ 初理解
    本地项目上传到GitHub
    new Date()之参数传递
  • 原文地址:https://www.cnblogs.com/LO-ME/p/4570724.html
Copyright © 2011-2022 走看看