如何在iOS TwitterKit中显示转推和类似计数?

问题描述 投票:1回答:1

在twitterKit中,有一个tweetView用于显示来自tweet模型对象的Tweet,但是在tweetView中没有用于显示转推和喜欢计数的字段。

cell.tweetView.showActionButtons = true;

这允许我们显示收藏和分享的动作按钮。但是我希望在每条推文中显示转推/喜欢的数量。我怎样才能实现?

ios twitter twitterkit
1个回答
0
投票

只需将常规UITableViewCell子类化并在其中使用TWTRTweetView。这基本上是TWTRTweetTableViewCell所做的,它有一个tweetView属性,它本质上是一个TWTRTweetView类型的IBOutlet,并在tableview单元格中使用它。

like and retweets计数的自定义标签放置在TWTRTweetView顶部的正确位置。

- (void)configureCell:(TWTRTweet *)tweet{
  self.customTweetView.showActionButtons = true;
  [self.customTweetView configureWithTweet:tweet];
  self.likesCount.text = [NSString stringWithFormat:@"%lld", tweet.likeCount];
  self.retweetsCount.text = [NSString stringWithFormat:@"%lld", tweet.retweetCount];
}

欲了解更多信息:check this SO post

© www.soinside.com 2019 - 2024. All rights reserved.