可滚动列表视图以涵盖主布局

时间:2017-03-10 03:09:20

标签: android android-layout listview

实现这种布局的概念是什么?

我有以下布局:

首先

-------------------------------------
|                                   |
-------------------------------------
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
|            MAIN LAYOUT            |
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
-------------------------------------
|                                   |
|             LISTVIEW              |
|                                   |
-------------------------------------

Listview位于主要布局之上。将列表视图滚动到底部(直到列表底部)时,列表视图将逐渐移动并逐渐覆盖主要布局:

最终

-------------------------------------
|                                   |
-------------------------------------
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
|             LISTVIEW              |
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
|                                   |
-------------------------------------

将listview滚动到顶部时,列表视图将再次逐渐移动到初始状态。

有人有想法吗?

2 个答案:

答案 0 :(得分:0)

from datetime import datetime
import csv
import numpy as np;

file = "your_file.csv"

outCsv = []
header = ['header1','header2',...,'headerN']
outCsv.append(header)

with open(file,'r') as csvfile:
    reader = csv.DictReader(csvfile)
    for row in reader:
        d = datetime.strptime(''.join(row['dateHeader'].rsplit(':', 1)), '%Y.%m.%d')
        iso_string = d.strftime('%Y-%m-%dT%H:%M:%S%z')
        tmpLine = [row['header1-value'],...,iso_string,row['headerN-value']]
        outCsv.append(tmpLine)


np.savetxt("file_to_import.csv",outCsv,delimiter=",", fmt="%s")

我希望它对你有帮助..!

答案 1 :(得分:0)

enter image description here

尝试此lib它将完全满足您的要求。 https://github.com/kaedea/Andriod-Seamless-ViewPager-Header