我创建一个XML文件presentation_main.xml:R可以没有解决......当内置XML代码
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/top"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:orientation="horizontal"
>
<TextView
android:text="..."
android:id="@+id/txtDate"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
</LinearLayout>
<LinearLayout
android:layout_below="@id/top"
android:layout_above="@id/bottom"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentLeft="true"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img1"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img2"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img3"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
</LinearLayout>
<LinearLayout
android:layout_below="@id/top"
android:layout_above="@id/bottom"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_centerHorizontal="true"
android:orientation="vertical"
>
<ImageView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:id="@+id/img4"
android:contentDescription="@string/shop"
android:src="@drawable/preloaderf1"
/>
</LinearLayout>
<LinearLayout
android:layout_below="@id/top"
android:layout_above="@id/bottom"
android:layout_width="wrap_content"
android:layout_height="fill_parent"
android:layout_alignParentRight="true"
android:orientation="vertical"
>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img5"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img6"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:id="@+id/img7"
android:contentDescription="@string/shop"
android:src="@drawable/ic_launcher"
/>
</LinearLayout>
<LinearLayout
android:id="@+id/bottom"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_marginBottom="20dp"
>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/level"
android:layout_marginLeft="15dp"
android:layout_marginRight="10dp"
android:textSize="25dp"
/>
<ProgressBar
android:id="@+id/proBar"
style="@android:style/Widget.ProgressBar.Horizontal"
android:layout_width="fill_parent"
android:layout_height="30dp"
android:layout_marginRight="15dp"
android:progress="50"
android:max="100"
/>
</LinearLayout>
</RelativeLayout>
什么错误?我建了>>> R无法解决?
布局设计如下,
xml文件ID错误?
使用引擎收录粘贴您的代码。请不要为此目的使用mediafire。 –
在StackOverflow上发布时,当您在StackOverflow上时,不会粘贴bin。 另外,你不应该从android包中导入R.这本身就是一个错误。 –
如果您使用eclipse,请展开您的res文件夹,并寻找红色感叹号以查找资源错误,修复,冲洗,重复,直到没有剩余。如果你没有任何清洁构建 – Idistic