首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >android coverflow视图

android coverflow视图
EN

Stack Overflow用户
提问于 2012-12-12 15:35:57
回答 1查看 1.7K关注 0票数 0

大家好,我正在开发android.In应用程序,我在coverflow视图中显示了一些图像,它覆盖了fine.Below flow视图。我需要在列表视图中显示一些数据。我是android新手,我不知道如何在coverflow view.please下面显示列表视图。帮助我,下面是我的代码:

代码语言:javascript
复制
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);



    }



    }
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-12-12 15:49:44

创建一个方向设置为垂直的LinearLayout,并将其设置为您的内容视图。然后将Cover flow视图和list视图添加到布局中。

如果你在一个布局xml中这样做,应该是这样的(将"com.example.package“改为你的CoverFlow所在的包):

代码语言:javascript
复制
<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>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/13834962

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档