是否可以在单个 uiimageview 中添加多个图像?
我有一个图像视图,我想在其中设置图像。我的设计师给了我一张与 imageview 高度相同但宽度为 imageview 的 1/10 的图像。他要求我像纹理一样在图像视图中重复它。
是否可以将多个图像添加到图像视图中?我知道我可以通过每次重复使用 10 个图像视图来做到这一点。还有其他类似纹理的方法吗?
I have an imageview in which I want an image to be set. My designer have given me an image which is of the same height of imageview but the width is 1/10th of the imageview. He asked me to repeat it inside the imageview like a texture.
Is it possible to add multiple images to an imageview? I know I can do it by using 10 imageviews for each reptition. Is there anyother way like the texture thing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
重要编辑:
虽然下面的答案是正确的,但我回答得太字面意思,并且没有建议适当的替代方案。
A
UIImageView
只能有一张图像,但您可以使用UIColor
的colorWithPatternImage
方法用重复图案填充UIView
:< em>旧答案
不,每个 UIImageView 只能有一个 UIImage。您的设计师应该自己重复一遍,并为您提供合适尺寸的图像。 iPhone不是网络,要求不同。
Important Edit:
While the answer below is correct, I answered this too literally and didn't suggest the appropriate alternative.
A
UIImageView
can only have one image, but you can fill aUIView
with a repeating pattern by usingUIColor
'scolorWithPatternImage
method:Old Answer
No, only one UIImage per UIImageView. Your designer should repeat it himself and give you an image of the appropriate size. The iPhone is not the web, requirements are different.