我正在尝试将文件列表发送到我的 Django 网站。每组都与以下信息一起传输:
现在,假设我有 100 组这样的数据,我想将它发送到我的 Django 网站,我应该使用的最佳方法是什么?
PS:我正在考虑使用 JSON,然后将该 JSON 数据发布到我的 Django URL。数据可能如下所示:
{
"files": [
{ "filename":"Movie1" , "filesize":"702", "filelocation":"C:/", "filetype":"avi" },
{ "filename":"Movie2" , "filesize":"800", "filelocation":"C:/", "filetype":"avi" },
{ "filename":"Movie3" , "filesize":"900", "filelocation":"C:/", "filetype":"avi" }
]
}
Run Code Online (Sandbox Code Playgroud) 所以,我非常喜欢Android上的Google Now卡片界面.最近它甚至还来到了iOS.
是否有任何教程或示例项目可以帮助我为我的iOS应用程序创建卡片界面?
根据我的研究,我已经能够使用自定义UICollectionViewFlowLayout复制"堆叠"卡.
- (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect
{
NSArray *allAttributesInRect = [super layoutAttributesForElementsInRect:rect];
CGPoint centerPoint = CGPointMake(CGRectGetMidX(self.collectionView.bounds), CGRectGetMidY(self.collectionView.bounds));
for (UICollectionViewLayoutAttributes *cellAttributes in allAttributesInRect)
{
if (CGRectContainsPoint(cellAttributes.frame, centerPoint))
{
cellAttributes.transform = CGAffineTransformIdentity;
cellAttributes.zIndex = 1.0;
}
else
{
cellAttributes.transform = CGAffineTransformMakeScale(0.75, 0.75);
}
}
return allAttributesInRect;
}
Run Code Online (Sandbox Code Playgroud)
然后我将最小行间距设置为负值,使它们显示为"堆叠".
滚动时,我希望卡片保持在底部,只有一辆汽车可以向上扩展并在屏幕中居中.然后我会将该卡从屏幕上滚动,堆栈中的下一张"卡片"将从堆栈向上滚动并在屏幕上居中.我猜这会动态调整最小行间距?
ajax ×1
animation ×1
css ×1
django ×1
google-now ×1
ios ×1
iphone ×1
javascript ×1
jquery ×1
objective-c ×1
python ×1
web ×1