在我的应用程序中,我需要从照片库中选择图像,其中有数百张照片。问题是相机拍摄的最新照片,保存在照片库的底部,因此,我必须向下滚动以选择我拍摄的最新照片。有什么方法可以将 ImagePickerViewController 的 View 滚动到底部,或者我可以将最新的图片存储在顶部吗?
[self presentViewController:imagePickerController animated:YES completion:^()
{
UIView *imagePickerView = imagePickerController.view;
UIView *view = [imagePickerView hitTest:CGPointMake(5,5) withEvent:nil];
while (![view isKindOfClass:[UIScrollView class]] && view != nil)
{
view = [view superview];
}
if ([view isKindOfClass:[UIScrollView class]])
{
UIScrollView *scrollView = (UIScrollView *) view;
CGPoint contentOffset = scrollView.contentOffset;
CGFloat y = MAX(contentOffset.y, [scrollView contentSize].height-scrollView.frame.size.height);
CGPoint bottomOffset = CGPointMake(0, y);
[scrollView setContentOffset:bottomOffset animated:YES];
}
}];
关于iphone - 我们可以以编程方式将 iPhone 照片库滚动到底部吗,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15634825/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |