大家好,我正在开发android.In应用程序,我在coverflow视图中显示了一些图像,它覆盖了fine.Below flow视图。我需要在列表视图中显示一些数据。我是android新手,我不知道如何在coverflow view.please下面显示列表视图。帮助我,下面是我的代码:
My XML file:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.coverflow.Coverflow
android:id="@+id/cover_flow"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView android:id="@+id/list" android:layout_width="fill_parent" android:layout_height="wrap_content" />
</LinearLayout>
My Activity class:
public class NewspaperCoverFlowActivity extends Activity
{
/** Called when the activity is first created. */
ListViewwithimageAdapter listadapter;
ListView list;
@Override
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
Coverflow coverFlow;
coverFlow = new Coverflow(this);
coverFlow.setAdapter(new ImageAdapter(this));
ImageAdapter coverImageAdapter = new ImageAdapter(this);
coverFlow.setAdapter(coverImageAdapter);
coverFlow.setGravity(Gravity.TOP);
coverFlow.setSpacing(2);
coverFlow.setSelection(1, true);
coverFlow.setAnimationDuration(1500);
// setContentView(coverFlow);
ListView list = (ListView)findViewById(R.id.list);
listadapter = new ListViewwithimageAdapter(this);
list.setAdapter(listadapter);
}
}发布于 2012-12-12 15:49:44
创建一个方向设置为垂直的LinearLayout,并将其设置为您的内容视图。然后将Cover flow视图和list视图添加到布局中。
如果你在一个布局xml中这样做,应该是这样的(将"com.example.package“改为你的CoverFlow所在的包):
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical" >
<com.example.package.CoverFlow
android:id="@+id/cover_flow"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<ListView
android:id="@+id/list"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
</LinearLayout>https://stackoverflow.com/questions/13834962
复制相似问题