小编Mar*_*lli的帖子

UICollectionView有两列,不同的单元格大小和一个接一个

这基本上就是我的目标:

在此输入图像描述

但我的集合视图看起来像这样:

在此输入图像描述

在不同的行之间有某种分隔符.我不需要它们用自动布局调整大小,它是4个单元格的重复模式,所以我知道每个单元格的确切大小.

我正在使用

  func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
Run Code Online (Sandbox Code Playgroud)

对于每个细胞的大小

这是我的流程布局:

let flowLayout = UICollectionViewFlowLayout()
    flowLayout.scrollDirection = .Vertical
    flowLayout.minimumLineSpacing = 10
    flowLayout.minimumInteritemSpacing = 5
Run Code Online (Sandbox Code Playgroud)

如何处理这种分离?

ios swift

5
推荐指数
1
解决办法
2578
查看次数

从其他文件中读取Bash变量赋值

我有这个测试脚本:

#!/bin/bash
echo "Read a variable" 
#open file
exec 6<test.txt
read EXAMPLE <&6
#close file again
exec 6<&-
echo $EXAMPLE
Run Code Online (Sandbox Code Playgroud)

该文件test.txt只有一行:

EXAMPLE=1
Run Code Online (Sandbox Code Playgroud)

输出是:

bash-3.2$ ./Read_Variables.sh
Read the variable
EXAMPLE=1
Run Code Online (Sandbox Code Playgroud)

$EXAMPLE在这种情况下,我只需要使用值1.那么我怎样才能避免EXAMPLE=在输出中获得部分?

谢谢

unix bash shell scripting

1
推荐指数
3
解决办法
7529
查看次数

标签 统计

bash ×1

ios ×1

scripting ×1

shell ×1

swift ×1

unix ×1