作者:刘刘刘刘刘志锋_506 | 来源:互联网 | 2023-05-17 10:35
Imlookingforinsightonabestpracticeforthefollowing:我正在寻找有关以下最佳实践的见解:IhaveaUITableVie
I'm looking for insight on a best practice for the following:
我正在寻找有关以下最佳实践的见解:
I have a UITableView in which I'd like to draw a custom shape into each UITableViewCell. Something such as the "pill" shape ellipse in Apple's mail app that describes how many messages are in a folder.
我有一个UITableView,我想在每个UITableViewCell中绘制一个自定义形状。诸如Apple的邮件应用程序中的“药丸”形状椭圆之类的东西,用于描述文件夹中有多少邮件。
What's the best practice for that? Should I subclass UIView, and add the class to my UITableView, then use drawAtPoint:?
最好的做法是什么?我应该将UIView子类化,并将该类添加到我的UITableView中,然后使用drawAtPoint:?
I prefer not subclassing UITableViewCell, and I'm almost certain there isn't a need for it. My cells are rather common otherwise.
我不喜欢子类化UITableViewCell,我几乎可以肯定它不需要它。我的细胞相当普遍。
How would you do that?
你会怎么做?
1 个解决方案