xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".activity.SplashActivity">
<ImageView
android:id="@+id/img_splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@drawable/splash"
/>
编写xml时的预览界面有没有图片显示?
控件有没有被其它控件给挡住?
: : EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BR.1.2.1.C1.05.00.02.085.142_msm8916_32_refs/tags/AU_LINUX_ANDROID_LA.BR.1.2.1.C1.05.00.02.085.142__release_AU (I1d82aa3ca9)
OpenGL ES Shader Compiler Version: E031.25.03.04
Build Date: 01/04/16 Mon
Local Branch:
Remote Branch: refs/tags/AU_LINUX_ANDROID_LA.BR.1.2.1.C1.05.00.02.085.142
Local Patches: NONE
Reconstruct Branch: NOTHING
//activity的代码:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_splash);
}
}
//xml文件的代码
```<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="match_parent"
android:layout_height="match_parent">
<ImageView
android:id="@+id/img_splash"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="centerCrop"
android:src="@mipmap/ic_aa"
/>
</LinearLayout>
// 我运行了一下没问题,可以显示,你借鉴一下试试