android启动页面显示空白,android – 启动时的空白页面
在獲取啟動畫面之前,當(dāng)我啟動應(yīng)用程序時,我會得到一個空白頁面(< 1s).我甚至試過幾乎空的潑水活動,但我仍然得到它! 怎么了? 清單文件
package="com.mypackage"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="15"
android:targetSdkVersion="18" />
android:icon="@drawable/ic_launcher"
android:label="@string/app_name">
SplashActivity.java
public class SplashActivity extends Activity{
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.splash);
}
splash.xml
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent" >
android:id="@+id/bg"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:src="@drawable/splash"
android:scaleType="centerCrop"/>
編輯
我試過一個默認(rèn)項目,但仍然有問題.救命!
AndroidManifest.xml中
package="com.blankpage.test"
android:versionCode="1"
android:versionName="1.0" >
android:minSdkVersion="15"
android:targetSdkVersion="18" />
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
android:name="com.blankpage.test.SplashActivity"
android:label="@string/app_name" >
SplashActivity
public class SplashActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);
}
@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;
}
}
splash.xml
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".SplashActivity"
android:background="#654456">
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello_world" />
總結(jié)
以上是生活随笔為你收集整理的android启动页面显示空白,android – 启动时的空白页面的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 基于Java学院网页的搜索引擎设计和实现
- 下一篇: linux安装服务程序,将 Go 程序安