Xcode:滚动视图与滚动视图中的图像
我试图使一个视图看起来几乎像 appStore 中的信息视图,文本位于视图的前半部分,图像位于后半部分。我尝试在另一个滚动视图中使用滚动视图。第一个视图(上半部分包含文本视图,下半部分包含滚动视图)滚动良好,但底部的滚动视图(包含多个图像视图)不滚动。
有什么想法如何使第二个滚动视图滚动吗?
scrollView是包含textview和scrollview的视图。
imageScrollView 是带有 imageview 的视图。
[scrollView setContentSize:CGSizeMake(320, 585)];
[imageScrollView setContentSize:CGSizeMake(1520, 400)];
I'm trying to make a view looking almost like the info-view in appStore, with text on the first half of the view and images on the second half. I've tried to use a scrollview in another scrollview. The first view (containing a textview on the top half and a scrollview on the bottom half) scrolls nice, but the scrollview at the bottom (containing several imageviews) doesn't scroll.
Any ideas how to make the second scrollview to scroll?
scrollView is the view containing a textview and a scrollview.
imageScrollView is the view with the imageviews.
[scrollView setContentSize:CGSizeMake(320, 585)];
[imageScrollView setContentSize:CGSizeMake(1520, 400)];
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我最近自己弄清楚了,但忘了发布答案。问题是我将 .xib 中的滚动视图的大小设置为与代码中相同的大小。当我将其更改为 320,416 和 320,400 时,我可以使用 setContentSize 滚动它们。然后,在 imageScrollView 中,我沿 x 轴添加图像(第一个图像位于 0,第二个图像位于图像宽度 + 小空间,依此类推)。希望这可以帮助某人。
I recently figured it out myself, but forgot to post the answer. The problem was that I set the sizes of the scrollviews in .xib to the same sizes as in the code. When I changed it to 320,416 and 320,400 I was able to scroll them with the setContentSize. In the imageScrollView I then added images along the x-axis (first image at 0, second at image width + a small space and so on). Hope this could help someone.
这是滚动视图显示图像的代码,来自文档目录 ByType .png 用户从 Iphone 照片库发送的图像
一切都好,我希望它有用谢谢您,如果是代码,请提供帮助,请提供您的反馈
HERE IS CODE OF scroll-view display images from Documents Directory ByType .png Images who seved by user from Iphone Photo Gallery
All The Very Best i Hope its useful Thank You If Thats code Help please give Your Feedback