Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 5 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
根据您的示例图像,这将是一个自定义对象,您必须将其创建为 UIImage 的子类。或者您可以采取更简单的路线,只需将其作为 Interface Builder 中的视图即可添加为子视图。
子类化
UIImage
的一个示例就像创建一个辅助方法:但是您必须自己实现全部绘制。
相反,我可能会说在 Interface Builder 中创建一个视图,该视图具有:
,您可以将其用作子视图,然后将它们设置为代码中正常的任何值。
Based on your sample image, this would be a custom object that you would have to create as a subclass of
UIImage
..or you could go the easier route just make it as a view in Interface Builder that you add as a subview.An example of subclassing
UIImage
would be like creating a helper method:but you would have to then implement drawing it all by yourself.
Instead, I would probably say go the route of creating a view in Interface Builder that has:
that you can use as a subview and then you'd set them to whatever values like normal in code.
我不确定,但是 Three20 是我在 Iphone 中见过的支持文本的最强大的项目和样式表。您可能想看一下
I am not sure, but Three20 is the most powerful project that I have ever seen in Iphone to support text and stylesheet. You may want to take a look
最好的方法是为图像的一侧创建一个 UI 标签,然后在图像下方创建另一个 UI 标签 - 然后根据原始文本一次计算第一个标签的高度,一旦你走了超过 UIImageView 的高度后,将其余文本放入底部 UILabel 中。
如果您想要一些示例代码,请给我发送电子邮件至 kigisoftware.com 的 kendall.gelner(我试图寻找一种向您发送电子邮件或 DM 的方式,但在该网站上找不到)。
The best way to go about this is to create a UI Label for the side of the image, then another UI label below the image - then calculate the height of the first label a word at a time from your original text, once you have gone past the height of the UIImageView put the rest of the text in the bottom UILabel.
If you would like some example code, please email me at kendall.gelner AT kigisoftware.com (I tried to look for a way to email or DM you, but could not find one on this site).