Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试制作一个 UIView(用于 UIViewElement),但是如何获得这个 UIViewElement 的边界(至少是宽度)?
谢谢魔乔
UIViewElement 只是将您传递给构造函数的视图添加到 UITableViewCell 的 ContentView 中。
由于单元格是动态的,并且并非所有单元格的大小都相同......
我建议您使用 ContentViewBounds 属性创建一个 UIViewElement 子类,并在您的自定义元素的 GetCell 方法中设置该值。