小编kch*_*mik的帖子

在当前时间创建AVPlayer的缩略图或图像

我实现了一个AVPlayer,我想在点击一个工具栏按钮时打开一个图像或缩略图,然后打开一个新UIViewControllerUIImageView.图像的缩放应与图像完全相同AVPlayer.在segue已经工作,我只是要实现,我在目前的播放时间获取图像.

谢谢!

xcode objective-c ipad

17
推荐指数
1
解决办法
2万
查看次数

在mongodb shell中打印文档值

我想在mongo shell中打印此JSON文档的值.像一个简单的控制台输出,无需创建新的集合或文档.

在此输入图像描述

提前致谢

mongodb mongodb-query

7
推荐指数
2
解决办法
2万
查看次数

UITableViewCell高度自动布局无法在iOS 10上运行

我有一个非常简单的UITableViewController,在这里我想设置一个文本上的每个textLabel中的UITableViewCell秒.

高度应通过autolayout计算.因此,在我viewDidLoadtableView属性中设置以下值:

tableView.estimatedRowHeight = UITableViewAutomaticDimension
tableView.rowHeight = UITableViewAutomaticDimension
Run Code Online (Sandbox Code Playgroud)

这是我的cellForRow方法,我初始化默认值UITableViewCell并将文本设置为其标签.

override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = UITableViewCell()
        cell.textLabel?.numberOfLines = 0
        cell.textLabel?.text = "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
        return cell
    }
Run Code Online (Sandbox Code Playgroud)

我的问题是,细胞不会根据标签的大小而增长.此问题仅出现在iOS 10上.在iOS 11上,所有内容都应该布局.

请检查以下屏幕截图:

  • iOS 10

在此输入图像描述

  • iOS 11

在此输入图像描述

编辑:2018年5月24日

拥有textLabel …

uitableview uikit swift

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

如何修复UICollectionViewCell的子类的不兼容指针

我已经实现了一个子类SPCellUICollectionViewCell,我用我创造我的细胞UICollectionViewController.现在,当我收集一个牢房时,为了对它做点什么,我得到一个警告Incompatible pointer types initializing 'SPCell *' with an expression of type 'UICollectionViewCell *'

这是一个例子.我的自定义单元格保存图像,我想更改alpha值.但是在我分配单元格的行中,我得到了这个警告.

- (void)collectionView:(UICollectionView *)collectionView didHighlightItemAtIndexPath:(NSIndexPath *)indexPath;{  
    SPCell *cell = [self.collectionView cellForItemAtIndexPath:indexPath];
    cell.thumbnail.alpha=0.6;
}
Run Code Online (Sandbox Code Playgroud)

提前致谢.

objective-c ios incomplete-type uicollectionviewcell

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