【问题标题】:Image in UIScrollView changes position after scrolling the tableUIScrollView 中的图像在滚动表格后更改位置
【发布时间】:2012-09-18 07:11:04
【问题描述】:

我有一个 UITableView 单元,其中包含一个 UIScroller,其中有一个 UIImage。

我遇到了一个问题,当我第一次加载视图时,一切看起来都不错,但是当我上下滚动时,它会发生变化。

这是之前的截图:

这是我滚动后的一个:

我在 UIScroller 中加载 UIImage 的代码是:

UIImageView *imageview = [[UIImageView alloc] initWithImage:myImage];

        imageview.frame = self.scrollview.bounds;

        self.scrollview.delegate = self;

        [self.scrollview addSubview:imageview];

谁能给我一些建议?我尝试使用以下堆栈溢出帖子中的代码,但到目前为止他们无法做到这一点:

UIImage Is Not Fitting In UIScrollView At Start UIScrollView with centered UIImageView, like Photos app

有什么建议吗?

谢谢

【问题讨论】:

    标签: ios uiscrollview gpuimage


    【解决方案1】:

    将滚动视图的contentSize 设置为图像视图的尺寸可能会有所帮助。

    【讨论】:

    • 做到了,但它没有做任何事情。当我滚动 UITableView 时会发生同样的事情
    猜你喜欢
    • 2014-08-06
    • 2015-11-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-04-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多