Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update FSPagerViewCell.swift #71

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Update FSPagerViewCell.swift
PamPanIOS authored Aug 22, 2017
commit 4cc2f0423be91ef3428c4642505d765d175a5c35
11 changes: 8 additions & 3 deletions Sources/FSPagerViewCell.swift
Original file line number Diff line number Diff line change
@@ -11,6 +11,7 @@ import UIKit
open class FSPagerViewCell: UICollectionViewCell {

/// Returns the label used for the main textual content of the pager view cell.
open var labelHeight: CGFloat = 0.0
open var textLabel: UILabel? {
if let _ = _textLabel {
return _textLabel
@@ -119,9 +120,13 @@ open class FSPagerViewCell: UICollectionViewCell {
if let textLabel = _textLabel {
textLabel.superview!.frame = {
var rect = self.contentView.bounds
let height = textLabel.font.pointSize*1.5
rect.size.height = height
rect.origin.y = self.contentView.frame.height-height
let height = textLabel.font.pointSize * 1.5
if labelHeight < height {
rect.size.height = height
} else {
rect.size.height = labelHeight
}
rect.origin.y = self.contentView.frame.height - rect.size.height
return rect
}()
textLabel.frame = {