我想在android中创建一个图库。为了设置需要的适配器来获取我在xml文件中定义的库。我这样做: 画廊g =(图库)findViewById(R.id.gallery1); 但是使用这段代码我无法编译我的项目,因为我得到错误“无法从视图转换为库”。我的XML文件是这样的:? “Android:无法从视图投射到图库
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<Gallery android:id="@+id/gallery1"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="bottom"
/>
</LinearLayout>
任何人知道如何解决我的问题,非常感谢
aahhh..ok。我发现我的错误。我也命名我的班级画廊,所以我发生名称冲突。谢谢 – meio 2010-07-08 10:58:03