2

I am using two collectionview. One for displaying story. Another for calendar. It will display last 15 days. I need left to right scroll, so content offset i used. Text I am receiving from parse, according to that text size, textview frame has been displayed. For story view, paging is enabled. So one by one story has been displayed. But, bottom, having date view, 4 dates displayed at a time. If I click 10th date, story view gets scroll to 10th story. But at that time, I textview is not displaying its content size. It is displaying its own size. But, if we scroll one by one, textview displaying exact size. Kindly guide me.

My Coding below.

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    if(collectionView == date_collection_view)
    {
    }
    else
    {
        cell.reading_area_txtvw.text = self.myConList.objectAtIndex(indexPath.row) as? String
        read_height = cell.reading_area_txtvw.contentSize.height // It is working when we scroll one by one story
        cell.reading_area_txtvw.frame = CGRect (x: 10 , y: 63, width: 300.0, height: read_height)
    }
}

func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
    if(collectionView == date_collection_view)
    {
        story_collection_view.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.None, animated: true)

        date_collection_view.scrollToItemAtIndexPath(indexPath, atScrollPosition: UICollectionViewScrollPosition.None, animated: true)

        //If we click some dates, exact story is displaying. But, textview content size is not displaying. Same size, what we have given in storyboard, that is displaying.
    }
}

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.