谁能告诉我为什么下面的代码不起作用?图像根本没有出现。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
<ImageView
android:src="@drawable/splashscreen"
android:scaleType="center"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</RelativeLayout>
最佳答案
在我的情况下,当我运行我的应用程序时,我的所有 fragment 的 imageViews 都没有显示。问题是,我从“FragmentActivity”扩展了我的“Activity”类。所以我只是将它“FragmentActivity”更改为“AppCompatActivity”
也许这会对某人有所帮助。
关于java - Android ImageView 不显示图像?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9798367/