0
如何在每个视图上使用UILabel进行页面控制以显示文本?我有viecontroller内的滚动视图和显示文本的标签。我需要创建尽可能多的视图来显示不同的文本。如何在每个视图中显示文本的页面控制
如何在每个视图上使用UILabel进行页面控制以显示文本?我有viecontroller内的滚动视图和显示文本的标签。我需要创建尽可能多的视图来显示不同的文本。如何在每个视图中显示文本的页面控制
而不是使用滚动视图,你可以使用的CollectionView具有分页功能,启用滚动型..需要大量的内存,其中的CollectionView重用细胞.. 使用收集水平流布局,使细胞大小
// Objective-C的
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath
{
return CGSizeMake(CGRectGetWidth(collectionView.frame), (CGRectGetHeight(collectionView.frame)));
}
//Swift
func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -> CGSize {
return CGSize(width: screenWidth, height: screenWidth);
}
感谢
你想用`UILabel`s更换UIPageControl`的`点
? –