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.
我在表格视图单元格中显示 2 个标签,我希望右标签与左标签的顶部对齐,但它始终与中间对齐。我尝试了许多自动布局约束,但似乎无法让它工作。
将此用于正确的标签:
[rightLabel sizeToFit];
这将设置标签高度以适合其内容,因此它不会在中间居中,它将从顶部开始。