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