From other posts about this subject, I tried the following approach - but in some way "fu" as well as " Bar "may be
func collectionView (see archive: UICollectionView, Layout ViewViewLayout: UICollectionViewFlowLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) - & gt; CGSize {var foo = collectionView.cellForItemAtIndexPath (indexpath) as? MessageCell var bar = foo? .messagetext.frame.height Return to Class:
CustomSheet: Code> Call the class message: UICollectionViewCell, Delegate the UIPopover Presentation Controller, UITextViewDelegate {@Iboutlet weak var AuthorLabel: UILBL! @IBOutlet Weak World Timestamp Label: UILball! @ IBOutlet weak var message text: UITextView! Func setCell (authorLabelText: string, message text: string, timestamp label text: string) {self.authorLabel? .text = authorLabelText self.timestampLabel? .text = timestampLabelText self message text? .text = messageText self.messageText.delegate = self.messageText .sizeToFit () // works, when I have a custom color background printline (auto-message.text.frame.hete)}}
I am giving a different heights to my custom cell orbit? There will be no such reason because it has not been sung yet, right?
€ dit: A screenshot from the stop at "foo":
on cell bar
is because Foo
is zero - this is the option that "?
" is doing in that expression if as the collection View.cellForItemAtIndexPath (indexPath)? The message is , which means either:
MessageCell
indexPath
, I suggest that more likely to be later That's because those representative messages are actually 'called by an illegal index route where you register your cell class (in code or in the storyboard), are you sure However, are they MessageCell
Registration as sales? <
No comments:
Post a Comment