Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/229.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 如何确定listview标题视图的位置_Android_Android Listview - Fatal编程技术网

Android 如何确定listview标题视图的位置

Android 如何确定listview标题视图的位置,android,android-listview,Android,Android Listview,我在应用程序中使用SwipListView(),我在其中添加了标题视图,如listView.addHeaderView(headerView) 我想修复此标题的位置,标题不应随listview滚动。我在这方面搜索了很多,但找不到任何解决方案,我只看到stickyListHeaders,但是他们的用户Framlayout为什么不使用listview顶部的布局作为标题呢。这样,当您滚动listview时,标题会固定在其位置 <LinearLayout android:orientatio

我在应用程序中使用SwipListView(),我在其中添加了标题视图,如listView.addHeaderView(headerView)


我想修复此标题的位置,标题不应随listview滚动。我在这方面搜索了很多,但找不到任何解决方案,我只看到stickyListHeaders,但是他们的用户Framlayout

为什么不使用listview顶部的布局作为标题呢。这样,当您滚动listview时,标题会固定在其位置

<LinearLayout
   android:orientation="vertical">   <-----Main Parent View---->

   <RelativeLayout> 


 <----Fixed Header View------->


   </RelativeLayout>


   <ListView> 


<----scrollable list view----->


  </ListView>

</LinearLayout>


在xml布局中的listview上方添加标题。如果使用listview,则不会滚动然后在xml中添加listview上方的标题。addHeaderView()这是在listview中添加的,而不是在view@Hectornaveen:我知道这个解决方案,但实际上我必须用xe货币应用程序中的动画将listView项目中的行与此标题交换,所以我的问题是,如果我使用不同的视图作为标题,那么动画就不会像xe CurrencyView那样发生,因为我在应用程序中使用SwipeListView完成了很多任务,如果我在github上使用StickyListHeaders或StickyScrollViewItems演示,那么我必须对其进行很多更改,并且还必须实现swipListView的右侧按钮