将一些 UILabel 放置在彼此之上并对 iPhone 中的动态尺寸做出反应
我从 iPhone 编程开始。我有一个导航控制器,我向其中推送一个新视图。对于这个新视图,我使用 XIB 文件创建了一个新的视图控制器类。在 Interface Builder 中,我在彼此上方添加了一些 UILabels,显示信息。 uilabels 的内容是在运行时定义的,大小应该是动态的。现在我做了一个
[label1 sizeToFit];
并且显示了动态内容!
但是:超出带有新添加文本的 label1 的所有标签现在都被该文本覆盖。我怎样才能让它们向下移动一点,这样它们就不会与 label1 重叠?我必须以编程方式执行此操作吗?
I'm starting with iPhone programming. I have a navigationcontroller
, to which I push an new view. For this new view I created a new viewcontroller class with XIB file. in Interface Builder I added some UILabels above each other, showing informations. the content of the uilabels is defined during runtime, the size should be dynamic. right now I do a
[label1 sizeToFit];
and the dynamic content is shown!
BUT: all labels which were beyond the label1 with the newly added text are now covered by this text. How could I manage them to just move down a bit so that they don't overlap with the label1? Fo I have to do this programmatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论