我目前在UIScrollView中有一个ImageView,它填充了我的整个ViewController。将UIScrollView内部的图像分成若干部分
这是我如何设置它:
[imageView setImage:image];
CGSize size = [imageView sizeThatFits:imageView.frame.size];
CGSize actualSize;
actualSize.height = imageView.frame.size.height;
actualSize.width = size.width/(1.0 * (size.height/imageView.frame.size.height));
CGRect frame = imageView.frame;
frame.size = actualSize;
[imageView setFrame:frame];
的问题是,我希望把多个ImageViews(约2〜3)我的滚动型内。每个部分/图像还应包含一个标题,该标题在滚动时位于顶部,以实现Instragram应用(发布图像的用户名,请参见http://i.imgur.com/rxgSfOq.png)或Apple音乐应用程序(当前信函)中的效果。 这可能吗?
调查UITableView。表格视图允许您在滚动列表中高效地显示许多项目(如Instagram的音乐),并允许您通过返回一个字符串来标记每个部分(如Music.app中)或将您自己的自定义视图与无论您想要什么信息(如Instagram)。 – Arman