我想知道如何在屏幕上绘制两张 PNG 图片。
我的 XML 布局:(命名为 paperxml.xml)
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/layoutid"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/paperid"
android:src="@drawable/paperrepresentation"
/>
<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/rockid"
android:src="@drawable/rockrepresentation"
android:layout_alignTop="@id/paperid"
/>
</RelativeLayout>
实例化 XML 布局并同时在屏幕上显示两个 ImageView 的 java 代码是什么?简单地调用setContentView(R.drawable.paperxml);
会使我的应用程序在启动时崩溃。